aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/network/protocol_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'swarm/network/protocol_test.go')
-rw-r--r--swarm/network/protocol_test.go15
1 files changed, 8 insertions, 7 deletions
diff --git a/swarm/network/protocol_test.go b/swarm/network/protocol_test.go
index 80d67e767..64ce7ba4a 100644
--- a/swarm/network/protocol_test.go
+++ b/swarm/network/protocol_test.go
@@ -83,7 +83,7 @@ func newBzzBaseTester(t *testing.T, n int, addr *BzzAddr, spec *protocols.Spec,
return srv(&BzzPeer{Peer: protocols.NewPeer(p, rw, spec), BzzAddr: NewAddr(p.Node())})
}
- s := p2ptest.NewProtocolTester(t, addr.ID(), n, protocol)
+ s := p2ptest.NewProtocolTester(addr.ID(), n, protocol)
for _, node := range s.Nodes {
cs[node.ID().String()] = make(chan bool)
@@ -116,9 +116,9 @@ func newBzz(addr *BzzAddr, lightNode bool) *Bzz {
return bzz
}
-func newBzzHandshakeTester(t *testing.T, n int, addr *BzzAddr, lightNode bool) *bzzTester {
+func newBzzHandshakeTester(n int, addr *BzzAddr, lightNode bool) *bzzTester {
bzz := newBzz(addr, lightNode)
- pt := p2ptest.NewProtocolTester(t, addr.ID(), n, bzz.runBzz)
+ pt := p2ptest.NewProtocolTester(addr.ID(), n, bzz.runBzz)
return &bzzTester{
addr: addr,
@@ -166,7 +166,7 @@ func correctBzzHandshake(addr *BzzAddr, lightNode bool) *HandshakeMsg {
func TestBzzHandshakeNetworkIDMismatch(t *testing.T) {
lightNode := false
addr := RandomAddr()
- s := newBzzHandshakeTester(t, 1, addr, lightNode)
+ s := newBzzHandshakeTester(1, addr, lightNode)
node := s.Nodes[0]
err := s.testHandshake(
@@ -183,7 +183,7 @@ func TestBzzHandshakeNetworkIDMismatch(t *testing.T) {
func TestBzzHandshakeVersionMismatch(t *testing.T) {
lightNode := false
addr := RandomAddr()
- s := newBzzHandshakeTester(t, 1, addr, lightNode)
+ s := newBzzHandshakeTester(1, addr, lightNode)
node := s.Nodes[0]
err := s.testHandshake(
@@ -200,7 +200,7 @@ func TestBzzHandshakeVersionMismatch(t *testing.T) {
func TestBzzHandshakeSuccess(t *testing.T) {
lightNode := false
addr := RandomAddr()
- s := newBzzHandshakeTester(t, 1, addr, lightNode)
+ s := newBzzHandshakeTester(1, addr, lightNode)
node := s.Nodes[0]
err := s.testHandshake(
@@ -225,7 +225,8 @@ func TestBzzHandshakeLightNode(t *testing.T) {
for _, test := range lightNodeTests {
t.Run(test.name, func(t *testing.T) {
randomAddr := RandomAddr()
- pt := newBzzHandshakeTester(nil, 1, randomAddr, false) // TODO change signature - t is not used anywhere
+ pt := newBzzHandshakeTester(1, randomAddr, false)
+
node := pt.Nodes[0]
addr := NewAddr(node)