From 0b6d1ad20bd629c9b309262339d400ece81d3840 Mon Sep 17 00:00:00 2001 From: vyzo Date: Wed, 9 Nov 2022 11:15:16 +0200 Subject: [PATCH] set predictable address when creating account actors --- chain/vm/mkactor.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/chain/vm/mkactor.go b/chain/vm/mkactor.go index 3a0ee6699..b33085c05 100644 --- a/chain/vm/mkactor.go +++ b/chain/vm/mkactor.go @@ -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