1
0
Fork 0
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:
Henrik Hautakoski 2023-01-17 21:01:09 +01:00
parent 2d369adabf
commit f589f5c0ed
2 changed files with 21 additions and 15 deletions

19
abi/helpers.go Normal file
View 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
}