2019-07-17 14:30:55 +00:00
|
|
|
package actors
|
|
|
|
|
|
|
|
import (
|
2019-07-22 16:08:54 +00:00
|
|
|
"github.com/filecoin-project/go-lotus/chain/actors/aerrors"
|
2019-07-17 14:30:55 +00:00
|
|
|
cbor "github.com/ipfs/go-ipld-cbor"
|
|
|
|
)
|
|
|
|
|
2019-07-17 16:00:59 +00:00
|
|
|
var (
|
|
|
|
EmptyStructCBOR = []byte{0xa0}
|
|
|
|
)
|
|
|
|
|
2019-07-22 16:08:54 +00:00
|
|
|
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
|
2019-07-17 14:30:55 +00:00
|
|
|
}
|