check that accounts aren't overwritten
This commit is contained in:
parent
e894f360a5
commit
99e71badbf
@ -288,7 +288,7 @@ func MakeInitialStateTree(ctx context.Context, bs bstore.Blockstore, template ge
|
|||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := createAccount(ctx, bs, cst, state, remAccKey, template.RemainderAccount); err != nil {
|
if err := createAccount(ctx, bs, cst, state, remAccKey, template.RemainderAccount, keyIDs); err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
err = state.SetActor(remAccKey, &types.Actor{
|
err = state.SetActor(remAccKey, &types.Actor{
|
||||||
|
@ -33,7 +33,6 @@ func SetupInitActor(bs bstore.Blockstore, netname string, initialActors []genesi
|
|||||||
amap := adt.MakeEmptyMap(store)
|
amap := adt.MakeEmptyMap(store)
|
||||||
|
|
||||||
keyToId := map[address.Address]address.Address{}
|
keyToId := map[address.Address]address.Address{}
|
||||||
|
|
||||||
counter := int64(AccountStart)
|
counter := int64(AccountStart)
|
||||||
|
|
||||||
for _, a := range initialActors {
|
for _, a := range initialActors {
|
||||||
@ -105,6 +104,9 @@ func SetupInitActor(bs bstore.Blockstore, netname string, initialActors []genesi
|
|||||||
return nil, nil, xerrors.Errorf("unmarshaling account meta: %w", err)
|
return nil, nil, xerrors.Errorf("unmarshaling account meta: %w", err)
|
||||||
}
|
}
|
||||||
for _, e := range ainfo.Signers {
|
for _, e := range ainfo.Signers {
|
||||||
|
if _, ok := keyToId[e]; ok {
|
||||||
|
continue
|
||||||
|
}
|
||||||
fmt.Printf("init set %s t0%d\n", e, counter)
|
fmt.Printf("init set %s t0%d\n", e, counter)
|
||||||
|
|
||||||
value := cbg.CborInt(counter)
|
value := cbg.CborInt(counter)
|
||||||
|
Loading…
Reference in New Issue
Block a user