set up initial account state of new Secp accounts

This commit is contained in:
Aayush Rajasekaran
2020-03-23 18:50:28 -07:00
committed by Jeromy
parent 72c6552b0b
commit 066b755b6a
+9 -1
View File
@@ -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