use built-in actor ID
The init actor will not allow the account actor to exec an arbitrary actor.
This commit is contained in:
parent
233d8a9b72
commit
c88d124954
@ -12,7 +12,6 @@ import (
|
|||||||
"github.com/filecoin-project/specs-actors/actors/builtin"
|
"github.com/filecoin-project/specs-actors/actors/builtin"
|
||||||
init_ "github.com/filecoin-project/specs-actors/actors/builtin/init"
|
init_ "github.com/filecoin-project/specs-actors/actors/builtin/init"
|
||||||
"github.com/filecoin-project/specs-actors/actors/runtime"
|
"github.com/filecoin-project/specs-actors/actors/runtime"
|
||||||
"github.com/multiformats/go-multihash"
|
|
||||||
"golang.org/x/xerrors"
|
"golang.org/x/xerrors"
|
||||||
|
|
||||||
"github.com/filecoin-project/lotus/chain/actors"
|
"github.com/filecoin-project/lotus/chain/actors"
|
||||||
@ -44,16 +43,8 @@ const testForkHeight = 40
|
|||||||
type testActor struct {
|
type testActor struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
var testActorCodeID = func() cid.Cid {
|
// must use existing actor that an account is allowed to exec.
|
||||||
builder := cid.V1Builder{Codec: cid.Raw, MhType: multihash.IDENTITY}
|
func (testActor) Code() cid.Cid { return builtin.PaymentChannelActorCodeID }
|
||||||
c, err := builder.Sum([]byte("fil/any/test"))
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
return c
|
|
||||||
}()
|
|
||||||
|
|
||||||
func (testActor) Code() cid.Cid { return testActorCodeID }
|
|
||||||
func (testActor) State() cbor.Er { return new(testActorState) }
|
func (testActor) State() cbor.Er { return new(testActorState) }
|
||||||
|
|
||||||
type testActorState struct {
|
type testActorState struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user