From 8842b21ec95b73cc6de85f0fa82ae3cbf60ddd7c Mon Sep 17 00:00:00 2001 From: Aayush Date: Wed, 25 Jan 2023 12:35:18 -0500 Subject: [PATCH] feat: vm: Assert empty object CID when dumping state --- chain/vm/invoker.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chain/vm/invoker.go b/chain/vm/invoker.go index 47bd2e326..2dd1f37e6 100644 --- a/chain/vm/invoker.go +++ b/chain/vm/invoker.go @@ -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 {