diff --git a/les/fetcher_test.go b/les/fetcher_test.go index 4ae7f6d04..cc678c8c1 100644 --- a/les/fetcher_test.go +++ b/les/fetcher_test.go @@ -14,13 +14,10 @@ import ( ) func TestFetcherULCPeerSelector(t *testing.T) { - - var ( - id1 enode.ID = newNodeID(t).ID() - id2 enode.ID = newNodeID(t).ID() - id3 enode.ID = newNodeID(t).ID() - id4 enode.ID = newNodeID(t).ID() - ) + id1 := newNodeID(t).ID() + id2 := newNodeID(t).ID() + id3 := newNodeID(t).ID() + id4 := newNodeID(t).ID() ftn1 := &fetcherTreeNode{ hash: common.HexToHash("1"), diff --git a/les/peer_test.go b/les/peer_test.go index 0ba9cbfd5..a0e0a300c 100644 --- a/les/peer_test.go +++ b/les/peer_test.go @@ -7,7 +7,6 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/les/flowcontrol" "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" "github.com/ethereum/go-ethereum/rlp" ) @@ -25,8 +24,7 @@ var ( //ulc connects to trusted peer and send announceType=announceTypeSigned func TestPeerHandshakeSetAnnounceTypeToAnnounceTypeSignedForTrustedPeer(t *testing.T) { - - var id enode.ID = newNodeID(t).ID() + id := newNodeID(t).ID() //peer to connect(on ulc side) p := peer{ @@ -74,7 +72,7 @@ func TestPeerHandshakeSetAnnounceTypeToAnnounceTypeSignedForTrustedPeer(t *testi } func TestPeerHandshakeAnnounceTypeSignedForTrustedPeersPeerNotInTrusted(t *testing.T) { - var id enode.ID = newNodeID(t).ID() + id := newNodeID(t).ID() p := peer{ Peer: p2p.NewPeer(id, "test peer", []p2p.Cap{}), version: protocol_version, @@ -118,7 +116,7 @@ func TestPeerHandshakeAnnounceTypeSignedForTrustedPeersPeerNotInTrusted(t *testi } func TestPeerHandshakeDefaultAllRequests(t *testing.T) { - var id enode.ID = newNodeID(t).ID() + id := newNodeID(t).ID() s := generateLesServer() @@ -147,7 +145,7 @@ func TestPeerHandshakeDefaultAllRequests(t *testing.T) { } func TestPeerHandshakeServerSendOnlyAnnounceRequestsHeaders(t *testing.T) { - var id enode.ID = newNodeID(t).ID() + id := newNodeID(t).ID() s := generateLesServer() s.onlyAnnounce = true @@ -181,7 +179,7 @@ func TestPeerHandshakeServerSendOnlyAnnounceRequestsHeaders(t *testing.T) { } } func TestPeerHandshakeClientReceiveOnlyAnnounceRequestsHeaders(t *testing.T) { - var id enode.ID = newNodeID(t).ID() + id := newNodeID(t).ID() p := peer{ Peer: p2p.NewPeer(id, "test peer", []p2p.Cap{}), @@ -212,7 +210,7 @@ func TestPeerHandshakeClientReceiveOnlyAnnounceRequestsHeaders(t *testing.T) { } func TestPeerHandshakeClientReturnErrorOnUselessPeer(t *testing.T) { - var id enode.ID = newNodeID(t).ID() + id := newNodeID(t).ID() p := peer{ Peer: p2p.NewPeer(id, "test peer", []p2p.Cap{}),