mirror of
https://github.com/eosswedenorg/thalos
synced 2026-06-18 04:40:03 +02:00
ship_processor.go: Move decodeAction() to abi/helpers.go
This commit is contained in:
parent
2d369adabf
commit
f589f5c0ed
2 changed files with 21 additions and 15 deletions
19
abi/helpers.go
Normal file
19
abi/helpers.go
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package abi
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
eos "github.com/eoscanada/eos-go"
|
||||
)
|
||||
|
||||
func DecodeAction(eos_ABI *eos.ABI, data []byte, actionName eos.ActionName) (interface{}, error) {
|
||||
var v interface{}
|
||||
|
||||
bytes, err := eos_ABI.DecodeAction(data, actionName)
|
||||
if err != nil {
|
||||
return v, err
|
||||
}
|
||||
|
||||
err = json.Unmarshal(bytes, &v)
|
||||
return v, err
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue