From b444771427a231d66ec9965442e73b3fca805355 Mon Sep 17 00:00:00 2001 From: whyrusleeping Date: Mon, 9 Dec 2019 19:40:54 +0100 Subject: [PATCH] setup enough fake peer IDs for miner generation --- node/modules/testing/genesis.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/node/modules/testing/genesis.go b/node/modules/testing/genesis.go index 4a379a129..f0195b639 100644 --- a/node/modules/testing/genesis.go +++ b/node/modules/testing/genesis.go @@ -87,6 +87,7 @@ func MakeGenesis(outFile, presealInfo string) func(bs dtypes.ChainBlockstore, w return nil, err } + var fakePeerIDs []peer.ID minerAddresses := make([]address.Address, 0, len(preseals)) for s := range preseals { a, err := address.NewFromString(s) @@ -97,10 +98,11 @@ func MakeGenesis(outFile, presealInfo string) func(bs dtypes.ChainBlockstore, w return nil, xerrors.New("expected ID address") } minerAddresses = append(minerAddresses, a) + fakePeerIDs = append(fakePeerIDs, peer.ID("peer"+a.String())) } gmc := &gen.GenMinerCfg{ - PeerIDs: []peer.ID{"peer ID 1"}, + PeerIDs: fakePeerIDs, PreSeals: preseals, MinerAddrs: minerAddresses, }