diff options
author | Elad <theman@elad.im> | 2019-01-25 00:23:34 +0800 |
---|---|---|
committer | Rafael Matias <rafael@skyle.net> | 2019-02-19 19:56:31 +0800 |
commit | 2695aa9e0d09e58817d2560ecdbd7b5b67f8f1b0 (patch) | |
tree | 597df951ae6ea5389bdb26b7199c9a299a155acb /swarm/network/protocol_test.go | |
parent | e247dcc141a5d1c9129b987a5f164e9df29be951 (diff) | |
download | go-tangerine-2695aa9e0d09e58817d2560ecdbd7b5b67f8f1b0.tar go-tangerine-2695aa9e0d09e58817d2560ecdbd7b5b67f8f1b0.tar.gz go-tangerine-2695aa9e0d09e58817d2560ecdbd7b5b67f8f1b0.tar.bz2 go-tangerine-2695aa9e0d09e58817d2560ecdbd7b5b67f8f1b0.tar.lz go-tangerine-2695aa9e0d09e58817d2560ecdbd7b5b67f8f1b0.tar.xz go-tangerine-2695aa9e0d09e58817d2560ecdbd7b5b67f8f1b0.tar.zst go-tangerine-2695aa9e0d09e58817d2560ecdbd7b5b67f8f1b0.zip |
p2p/testing, swarm: remove unused testing.T in protocol tester (#18500)
(cherry picked from commit 2abeb35d5425d72c2f7fdfe4209f7a94fac52a8e)
Diffstat (limited to 'swarm/network/protocol_test.go')
-rw-r--r-- | swarm/network/protocol_test.go | 15 |
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) |