diff options
author | Viktor TrĂ³n <viktor.tron@gmail.com> | 2018-09-12 17:24:56 +0800 |
---|---|---|
committer | Balint Gabor <balint.g@gmail.com> | 2018-09-12 17:24:56 +0800 |
commit | bfce00385f1c8dab222b7ddab6c336177a5ae731 (patch) | |
tree | 8b3d2b2ce30e8b5eaf6db5b89a6c5570c3997cff /swarm/network/hive_test.go | |
parent | b06ff563a1f1095407612e04a1707e13d2dc20da (diff) | |
download | dexon-bfce00385f1c8dab222b7ddab6c336177a5ae731.tar.gz dexon-bfce00385f1c8dab222b7ddab6c336177a5ae731.tar.zst dexon-bfce00385f1c8dab222b7ddab6c336177a5ae731.zip |
Kademlia refactor (#17641)
* swarm/network: simplify kademlia/hive; rid interfaces
* swarm, swarm/network/stream, swarm/netork/simulations,, swarm/pss: adapt to new Kad API
* swarm/network: minor changes re review; add missing lock to NeighbourhoodDepthC
Diffstat (limited to 'swarm/network/hive_test.go')
-rw-r--r-- | swarm/network/hive_test.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/swarm/network/hive_test.go b/swarm/network/hive_test.go index c2abfb2aa..7ea000c1a 100644 --- a/swarm/network/hive_test.go +++ b/swarm/network/hive_test.go @@ -41,7 +41,7 @@ func TestRegisterAndConnect(t *testing.T) { id := s.IDs[0] raddr := NewAddrFromNodeID(id) - pp.Register([]OverlayAddr{OverlayAddr(raddr)}) + pp.Register(raddr) // start the hive and wait for the connection err := pp.Start(s.Server) @@ -77,7 +77,7 @@ func TestHiveStatePersistance(t *testing.T) { peers := make(map[string]bool) for _, id := range s.IDs { raddr := NewAddrFromNodeID(id) - pp.Register([]OverlayAddr{OverlayAddr(raddr)}) + pp.Register(raddr) peers[raddr.String()] = true } @@ -97,8 +97,8 @@ func TestHiveStatePersistance(t *testing.T) { pp.Start(s1.Server) i := 0 - pp.Overlay.EachAddr(nil, 256, func(addr OverlayAddr, po int, nn bool) bool { - delete(peers, addr.(*BzzAddr).String()) + pp.Kademlia.EachAddr(nil, 256, func(addr *BzzAddr, po int, nn bool) bool { + delete(peers, addr.String()) i++ return true }) |