swarm/network: remove unused vars from testHandshake

This commit is contained in:
Anton Evangelatov 2018-11-07 12:56:51 +01:00
parent 4021698d4e
commit 9a847448c5
3 changed files with 3 additions and 18 deletions

View file

@ -292,7 +292,7 @@ func TestBzzFeed(t *testing.T) {
if resp.StatusCode != http.StatusOK { if resp.StatusCode != http.StatusOK {
t.Fatalf("err %s", resp.Status) t.Fatalf("err %s", resp.Status)
} }
b, err := ioutil.ReadAll(resp.Body) b, err = ioutil.ReadAll(resp.Body)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }

View file

@ -153,18 +153,7 @@ func newBzzHandshakeTester(t *testing.T, n int, addr *BzzAddr, lightNode bool) *
// should test handshakes in one exchange? parallelisation // should test handshakes in one exchange? parallelisation
func (s *bzzTester) testHandshake(lhs, rhs *HandshakeMsg, disconnects ...*p2ptest.Disconnect) error { func (s *bzzTester) testHandshake(lhs, rhs *HandshakeMsg, disconnects ...*p2ptest.Disconnect) error {
//TODO: peers is not used. fix test. if err := s.TestExchanges(HandshakeMsgExchange(lhs, rhs, rhs.Addr.ID())...); err != nil {
var peers []enode.ID
id := rhs.Addr.ID()
if len(disconnects) > 0 {
for _, d := range disconnects {
peers = append(peers, d.Peer)
}
} else {
peers = []enode.ID{id}
}
if err := s.TestExchanges(HandshakeMsgExchange(lhs, rhs, id)...); err != nil {
return err return err
} }

View file

@ -92,11 +92,7 @@ func (u *ID) binaryGet(serializedData []byte) error {
} }
cursor += feedLength cursor += feedLength
if err := u.Epoch.UnmarshalBinary(serializedData[cursor : cursor+lookup.EpochLength]); err != nil { return u.Epoch.UnmarshalBinary(serializedData[cursor : cursor+lookup.EpochLength])
return err
}
return nil
} }
// FromValues deserializes this instance from a string key-value store // FromValues deserializes this instance from a string key-value store