aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/network/stream/delivery_test.go
diff options
context:
space:
mode:
authorElad <theman@elad.im>2018-12-17 19:19:01 +0800
committerAnton Evangelatov <anton.evangelatov@gmail.com>2018-12-17 19:19:01 +0800
commit472c23a8015cd84b193d2d0efb4592a664de3c62 (patch)
tree2344bab40a7328567179ec889b2432039cd28cf4 /swarm/network/stream/delivery_test.go
parentd322c9d5504ad3fd4dfeb9dff29e92b35856042f (diff)
downloaddexon-472c23a8015cd84b193d2d0efb4592a664de3c62.tar
dexon-472c23a8015cd84b193d2d0efb4592a664de3c62.tar.gz
dexon-472c23a8015cd84b193d2d0efb4592a664de3c62.tar.bz2
dexon-472c23a8015cd84b193d2d0efb4592a664de3c62.tar.lz
dexon-472c23a8015cd84b193d2d0efb4592a664de3c62.tar.xz
dexon-472c23a8015cd84b193d2d0efb4592a664de3c62.tar.zst
dexon-472c23a8015cd84b193d2d0efb4592a664de3c62.zip
p2p/simulation: move connection methods from swarm/network/simulation (#18323)
Diffstat (limited to 'swarm/network/stream/delivery_test.go')
-rw-r--r--swarm/network/stream/delivery_test.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/swarm/network/stream/delivery_test.go b/swarm/network/stream/delivery_test.go
index f69f80499..f537c1323 100644
--- a/swarm/network/stream/delivery_test.go
+++ b/swarm/network/stream/delivery_test.go
@@ -505,7 +505,8 @@ func testDeliveryFromNodes(t *testing.T, nodes, conns, chunkCount int, skipCheck
result := sim.Run(ctx, func(ctx context.Context, sim *simulation.Simulation) error {
nodeIDs := sim.UpNodeIDs()
//determine the pivot node to be the first node of the simulation
- sim.SetPivotNode(nodeIDs[0])
+ pivot := nodeIDs[0]
+
//distribute chunks of a random file into Stores of nodes 1 to nodes
//we will do this by creating a file store with an underlying round-robin store:
//the file store will create a hash for the uploaded file, but every chunk will be
@@ -519,7 +520,7 @@ func testDeliveryFromNodes(t *testing.T, nodes, conns, chunkCount int, skipCheck
//...iterate the buckets...
for id, bucketVal := range lStores {
//...and remove the one which is the pivot node
- if id == *sim.PivotNodeID() {
+ if id == pivot {
continue
}
//the other ones are added to the array...
@@ -547,7 +548,7 @@ func testDeliveryFromNodes(t *testing.T, nodes, conns, chunkCount int, skipCheck
}
//get the pivot node's filestore
- item, ok := sim.NodeItem(*sim.PivotNodeID(), bucketKeyFileStore)
+ item, ok := sim.NodeItem(pivot, bucketKeyFileStore)
if !ok {
return fmt.Errorf("No filestore")
}