From c88d124954221398c7bab5f524dccbaad095c997 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 28 Sep 2020 14:43:55 -0700 Subject: [PATCH] use built-in actor ID The init actor will not allow the account actor to exec an arbitrary actor. --- chain/stmgr/forks_test.go | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/chain/stmgr/forks_test.go b/chain/stmgr/forks_test.go index ee378c983..9db6a491a 100644 --- a/chain/stmgr/forks_test.go +++ b/chain/stmgr/forks_test.go @@ -12,7 +12,6 @@ import ( "github.com/filecoin-project/specs-actors/actors/builtin" init_ "github.com/filecoin-project/specs-actors/actors/builtin/init" "github.com/filecoin-project/specs-actors/actors/runtime" - "github.com/multiformats/go-multihash" "golang.org/x/xerrors" "github.com/filecoin-project/lotus/chain/actors" @@ -44,16 +43,8 @@ const testForkHeight = 40 type testActor struct { } -var testActorCodeID = func() cid.Cid { - builder := cid.V1Builder{Codec: cid.Raw, MhType: multihash.IDENTITY} - c, err := builder.Sum([]byte("fil/any/test")) - if err != nil { - panic(err) - } - return c -}() - -func (testActor) Code() cid.Cid { return testActorCodeID } +// must use existing actor that an account is allowed to exec. +func (testActor) Code() cid.Cid { return builtin.PaymentChannelActorCodeID } func (testActor) State() cbor.Er { return new(testActorState) } type testActorState struct {