Skip to content

Commit

Permalink
SerializeParams should return ErrSerialization
Browse files Browse the repository at this point in the history
  • Loading branch information
arajasek committed Nov 17, 2020
1 parent 5c791cd commit 2219bff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion chain/actors/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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
}

0 comments on commit 2219bff

Please sign in to comment.