lotus/chain/actors/params.go
Jakub Sztandera 020fb6f8a3 Mid rework
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2019-07-23 14:45:44 +02:00

19 lines
374 B
Go

package actors
import (
"github.com/filecoin-project/go-lotus/chain/actors/aerrors"
cbor "github.com/ipfs/go-ipld-cbor"
)
var (
EmptyStructCBOR = []byte{0xa0}
)
func SerializeParams(i interface{}) ([]byte, aerrors.ActorError) {
dump, err := cbor.DumpObject(i)
if err != nil {
return nil, aerrors.Absorb(err, 1, "failed to encode parameter")
}
return dump, nil
}