From f73366630f3b0d2e287b6ae34b35b0c42a2509ea Mon Sep 17 00:00:00 2001 From: frrist Date: Tue, 5 May 2020 11:23:55 -0700 Subject: [PATCH] add puppet actor to vm invoker in driver --- chain/validation/applier.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/chain/validation/applier.go b/chain/validation/applier.go index 89924ebee..5289f840b 100644 --- a/chain/validation/applier.go +++ b/chain/validation/applier.go @@ -2,13 +2,13 @@ package validation import ( "context" - "golang.org/x/xerrors" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" "github.com/filecoin-project/specs-actors/actors/builtin" "github.com/filecoin-project/specs-actors/actors/crypto" + "github.com/filecoin-project/specs-actors/actors/puppet" "github.com/ipfs/go-cid" vtypes "github.com/filecoin-project/chain-validation/chain/types" @@ -135,6 +135,10 @@ func (a *Applier) applyMessage(epoch abi.ChainEpoch, lm types.ChainMsg) (vtypes. base := a.stateWrapper.Root() lotusVM, err := vm.NewVM(base, epoch, &vmRand{}, a.stateWrapper.bs, vdrivers.NewChainValidationSyscalls()) + // need to modify the VM invoker to add the puppet actor + chainValInvoker := vm.NewInvoker() + chainValInvoker.Register(puppet.PuppetActorCodeID, puppet.Actor{}, puppet.State{}) + lotusVM.SetInvoker(chainValInvoker) if err != nil { return vtypes.MessageReceipt{}, big.Zero(), big.Zero(), err }