feat: vm: Assert empty object CID when dumping state
This commit is contained in:
parent
e84dad0967
commit
8842b21ec9
@ -291,7 +291,10 @@ func DumpActorState(i *ActorRegistry, act *types.Actor, b []byte) (interface{},
|
|||||||
|
|
||||||
um := actInfo.vmActor.State()
|
um := actInfo.vmActor.State()
|
||||||
if um == nil {
|
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
|
return nil, nil
|
||||||
}
|
}
|
||||||
if err := um.UnmarshalCBOR(bytes.NewReader(b)); err != nil {
|
if err := um.UnmarshalCBOR(bytes.NewReader(b)); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user