From 2219bff1c9faeb7c2a2da44dcdb32e69083f8376 Mon Sep 17 00:00:00 2001 From: Aayush Rajasekaran Date: Tue, 17 Nov 2020 00:28:27 -0500 Subject: [PATCH] SerializeParams should return ErrSerialization --- chain/actors/params.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chain/actors/params.go b/chain/actors/params.go index e14dcafc9..6dc0b1084 100644 --- a/chain/actors/params.go +++ b/chain/actors/params.go @@ -3,6 +3,8 @@ package actors import ( "bytes" + "github.com/filecoin-project/go-state-types/exitcode" + "github.com/filecoin-project/lotus/chain/actors/aerrors" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -11,7 +13,7 @@ func SerializeParams(i cbg.CBORMarshaler) ([]byte, aerrors.ActorError) { buf := new(bytes.Buffer) if err := i.MarshalCBOR(buf); err != nil { // TODO: shouldnt this be a fatal error? - return nil, aerrors.Absorb(err, 1, "failed to encode parameter") + return nil, aerrors.Absorb(err, exitcode.ErrSerialization, "failed to encode parameter") } return buf.Bytes(), nil }