From 63ad6bc325e7a60ef3430a443aeda0b391cc670d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20M=C3=A4kel=C3=A4?= Date: Wed, 19 Aug 2020 12:25:38 +0300 Subject: [PATCH] need to merge --- chain/gen/genesis/genesis.go | 5 +++++ chain/gen/genesis/t01_init.go | 5 +++++ go.sum | 1 + 3 files changed, 11 insertions(+) diff --git a/chain/gen/genesis/genesis.go b/chain/gen/genesis/genesis.go index 4d059a3a2..de4a1a989 100644 --- a/chain/gen/genesis/genesis.go +++ b/chain/gen/genesis/genesis.go @@ -298,6 +298,11 @@ func createAccount(ctx context.Context, bs bstore.Blockstore, cst cbor.IpldStore for _, e := range ainfo.Signers { idAddress, _ := keyIDs[e] + // Check if actor already exists + _, err := state.GetActor(e) + if err == nil { + continue + } st, err := cst.Put(ctx, &account.State{Address: e}) if err != nil { return err diff --git a/chain/gen/genesis/t01_init.go b/chain/gen/genesis/t01_init.go index 7d00601f2..b15ada470 100644 --- a/chain/gen/genesis/t01_init.go +++ b/chain/gen/genesis/t01_init.go @@ -43,6 +43,11 @@ func SetupInitActor(bs bstore.Blockstore, netname string, initialActors []genesi return nil, nil, xerrors.Errorf("unmarshaling account meta: %w", err) } for _, e := range ainfo.Signers { + + if _, ok := keyToId[e]; ok { + continue + } + fmt.Printf("init set %s t0%d\n", e, counter) value := cbg.CborInt(counter) diff --git a/go.sum b/go.sum index 2f3da883a..e792431f5 100644 --- a/go.sum +++ b/go.sum @@ -276,6 +276,7 @@ github.com/filecoin-project/specs-actors v0.8.7-0.20200811203034-272d022c1923 h1 github.com/filecoin-project/specs-actors v0.8.7-0.20200811203034-272d022c1923/go.mod h1:hukRu6vKQrrS7Nt+fC/ql4PqWLSfmAWNshD/VDtARZU= github.com/filecoin-project/specs-actors v0.9.2 h1:0JG0QLHw8pO6BPqPRe9eQxQW60biHAQsx1rlQ9QbzZ0= github.com/filecoin-project/specs-actors v0.9.2/go.mod h1:YasnVUOUha0DN5wB+twl+V8LlDKVNknRG00kTJpsfFA= +github.com/filecoin-project/specs-actors v0.9.3 h1:Fi75G/UQ7R4eiIwnN+S6bBQ9LqKivyJdw62jJzTi6aE= github.com/filecoin-project/specs-storage v0.1.1-0.20200622113353-88a9704877ea h1:iixjULRQFPn7Q9KlIqfwLJnlAXO10bbkI+xy5GKGdLY= github.com/filecoin-project/specs-storage v0.1.1-0.20200622113353-88a9704877ea/go.mod h1:Pr5ntAaxsh+sLG/LYiL4tKzvA83Vk5vLODYhfNwOg7k= github.com/filecoin-project/specs-storage v0.1.1-0.20200730063404-f7db367e9401 h1:jLzN1hwO5WpKPu8ASbW8fs1FUCsOWNvoBXzQhv+8/E8=