diff options
Diffstat (limited to 'swarm/network/stream/syncer_test.go')
-rw-r--r-- | swarm/network/stream/syncer_test.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/swarm/network/stream/syncer_test.go b/swarm/network/stream/syncer_test.go index 469d520f8..f2be3bef9 100644 --- a/swarm/network/stream/syncer_test.go +++ b/swarm/network/stream/syncer_test.go @@ -31,7 +31,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/discover" + "github.com/ethereum/go-ethereum/p2p/enode" "github.com/ethereum/go-ethereum/p2p/simulations/adapters" "github.com/ethereum/go-ethereum/swarm/log" "github.com/ethereum/go-ethereum/swarm/network" @@ -50,7 +50,7 @@ func TestSyncerSimulation(t *testing.T) { testSyncBetweenNodes(t, 16, 1, dataChunkCount, true, 1) } -func createMockStore(globalStore *mockdb.GlobalStore, id discover.NodeID, addr *network.BzzAddr) (lstore storage.ChunkStore, datadir string, err error) { +func createMockStore(globalStore *mockdb.GlobalStore, id enode.ID, addr *network.BzzAddr) (lstore storage.ChunkStore, datadir string, err error) { address := common.BytesToAddress(id.Bytes()) mockStore := globalStore.NewNodeStore(address) params := storage.NewDefaultLocalStoreParams() @@ -72,8 +72,8 @@ func testSyncBetweenNodes(t *testing.T, nodes, conns, chunkCount int, skipCheck var globalStore *mockdb.GlobalStore var gDir, datadir string - id := ctx.Config.ID - addr := network.NewAddrFromNodeID(id) + node := ctx.Config.Node() + addr := network.NewAddr(node) //hack to put addresses in same space addr.OAddr[0] = byte(0) @@ -82,9 +82,9 @@ func testSyncBetweenNodes(t *testing.T, nodes, conns, chunkCount int, skipCheck if err != nil { return nil, nil, fmt.Errorf("Something went wrong; using mockStore enabled but globalStore is nil") } - store, datadir, err = createMockStore(globalStore, id, addr) + store, datadir, err = createMockStore(globalStore, node.ID(), addr) } else { - store, datadir, err = createTestLocalStorageForID(id, addr) + store, datadir, err = createTestLocalStorageForID(node.ID(), addr) } if err != nil { return nil, nil, err @@ -113,7 +113,7 @@ func testSyncBetweenNodes(t *testing.T, nodes, conns, chunkCount int, skipCheck bucket.Store(bucketKeyDelivery, delivery) - r := NewRegistry(addr, delivery, netStore, state.NewInmemoryStore(), &RegistryOptions{ + r := NewRegistry(addr.ID(), delivery, netStore, state.NewInmemoryStore(), &RegistryOptions{ SkipCheck: skipCheck, }) @@ -139,7 +139,7 @@ func testSyncBetweenNodes(t *testing.T, nodes, conns, chunkCount int, skipCheck result := sim.Run(ctx, func(ctx context.Context, sim *simulation.Simulation) error { nodeIDs := sim.UpNodeIDs() - nodeIndex := make(map[discover.NodeID]int) + nodeIndex := make(map[enode.ID]int) for i, id := range nodeIDs { nodeIndex[id] = i } |