storage miner node needs mocknet option

This commit is contained in:
whyrusleeping 2019-11-06 09:21:37 -08:00 committed by Łukasz Magiera
parent a49b949dca
commit 7cb4148b18
2 changed files with 4 additions and 3 deletions

View File

@ -24,7 +24,6 @@ func TestDealFlow(t *testing.T, b APIBuilder) {
if err != nil {
t.Fatal(err)
}
addrinfo.Addrs = nil
if err := miner.NetConnect(ctx, addrinfo); err != nil {
t.Fatal(err)

View File

@ -31,7 +31,7 @@ import (
"github.com/filecoin-project/lotus/node/repo"
)
func testStorageNode(ctx context.Context, t *testing.T, waddr address.Address, act address.Address, pk crypto.PrivKey, tnd test.TestNode) test.TestStorageNode {
func testStorageNode(ctx context.Context, t *testing.T, waddr address.Address, act address.Address, pk crypto.PrivKey, tnd test.TestNode, mn mocknet.Mocknet) test.TestStorageNode {
r := repo.NewMemory(nil)
lr, err := r.Lock(repo.RepoStorageMiner)
@ -90,6 +90,8 @@ func testStorageNode(ctx context.Context, t *testing.T, waddr address.Address, a
node.Repo(r),
node.Test(),
node.MockHost(mn),
node.Override(new(*sectorbuilder.Config), modules.SectorBuilderConfig(secbpath, 2)),
node.Override(new(api.FullNode), tnd),
)
@ -174,7 +176,7 @@ func builder(t *testing.T, nFull int, storage []int) ([]test.TestNode, []test.Te
genMiner, err := address.NewFromString("t0101")
require.NoError(t, err)
storers[i] = testStorageNode(ctx, t, wa, genMiner, pk, f)
storers[i] = testStorageNode(ctx, t, wa, genMiner, pk, f, mn)
}
if err := mn.LinkAll(); err != nil {