Skip to content

Commit

Permalink
Merge pull request #10117 from filecoin-project/asr/resolve-TODO
Browse files Browse the repository at this point in the history
feat: vm: Assert empty object CID when dumping state
  • Loading branch information
jennijuju authored Jan 26, 2023
2 parents c6829a9 + 8842b21 commit 2ad9301
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion chain/vm/invoker.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,10 @@ func DumpActorState(i *ActorRegistry, act *types.Actor, b []byte) (interface{},

um := actInfo.vmActor.State()
if um == nil {
// TODO::FVM @arajasek I would like to assert that we have the empty object here
if act.Code != EmptyObjectCid {
return nil, xerrors.Errorf("actor with code %s should only have empty object (%s) as its Head, instead has %s", act.Code, EmptyObjectCid, act.Head)
}

return nil, nil
}
if err := um.UnmarshalCBOR(bytes.NewReader(b)); err != nil {
Expand Down

0 comments on commit 2ad9301

Please sign in to comment.