Merge pull request #10117 from filecoin-project/asr/resolve-TODO

feat: vm: Assert empty object CID when dumping state
This commit is contained in:
Jiaying Wang 2023-01-25 21:29:24 -05:00 committed by GitHub
commit 2ad9301a6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {