set predictable address when creating account actors
This commit is contained in:
parent
335d0bec3e
commit
0b6d1ad20b
@ -89,7 +89,7 @@ func TryCreateAccountActor(rt *Runtime, addr address.Address) (*types.Actor, add
|
||||
func makeAccountActor(ver actorstypes.Version, addr address.Address) (*types.Actor, aerrors.ActorError) {
|
||||
switch addr.Protocol() {
|
||||
case address.BLS, address.SECP256K1:
|
||||
return newAccountActor(ver), nil
|
||||
return newAccountActor(ver, addr), nil
|
||||
case address.ID:
|
||||
return nil, aerrors.Newf(exitcode.SysErrInvalidReceiver, "no actor with given ID: %s", addr)
|
||||
case address.Actor:
|
||||
@ -99,7 +99,7 @@ func makeAccountActor(ver actorstypes.Version, addr address.Address) (*types.Act
|
||||
}
|
||||
}
|
||||
|
||||
func newAccountActor(ver actorstypes.Version) *types.Actor {
|
||||
func newAccountActor(ver actorstypes.Version, addr address.Address) *types.Actor {
|
||||
// TODO: ActorsUpgrade use a global actor registry?
|
||||
var code cid.Cid
|
||||
switch ver {
|
||||
@ -124,6 +124,7 @@ func newAccountActor(ver actorstypes.Version) *types.Actor {
|
||||
Code: code,
|
||||
Balance: types.NewInt(0),
|
||||
Head: EmptyObjectCid,
|
||||
Address: &addr,
|
||||
}
|
||||
|
||||
return nact
|
||||
|
Loading…
Reference in New Issue
Block a user