From 066b755b6a86f6d3cee1d37733bdb079bde64008 Mon Sep 17 00:00:00 2001 From: Aayush Rajasekaran Date: Mon, 23 Mar 2020 05:43:30 -0400 Subject: [PATCH] set up initial account state of new Secp accounts --- chain/vm/mkactor.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/chain/vm/mkactor.go b/chain/vm/mkactor.go index 9e14384cd..d8bc7bca8 100644 --- a/chain/vm/mkactor.go +++ b/chain/vm/mkactor.go @@ -74,10 +74,18 @@ func NewBLSAccountActor(st *state.StateTree, addr address.Address) (*types.Actor } func NewSecp256k1AccountActor(st *state.StateTree, addr address.Address) (*types.Actor, aerrors.ActorError) { + var acstate account.State + acstate.Address = addr + + c, err := st.Store.Put(context.TODO(), &acstate) + if err != nil { + return nil, aerrors.Escalate(err, "serializing account actor state") + } + nact := &types.Actor{ Code: builtin.AccountActorCodeID, Balance: types.NewInt(0), - Head: EmptyObjectCid, + Head: c, } return nact, nil