aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Halpern <matthalp@google.com>2019-02-25 18:49:49 +0800
committerPéter Szilágyi <peterke@gmail.com>2019-02-25 18:49:49 +0800
commitbadaf43019dce961d6562b81d34de214e9e8ac0f (patch)
treef5588c15823e862bd76e9e522109a24e11356c7a
parent7d881e45bdaad3cf1a301c7523a07026a479fd04 (diff)
downloadgo-tangerine-badaf43019dce961d6562b81d34de214e9e8ac0f.tar
go-tangerine-badaf43019dce961d6562b81d34de214e9e8ac0f.tar.gz
go-tangerine-badaf43019dce961d6562b81d34de214e9e8ac0f.tar.bz2
go-tangerine-badaf43019dce961d6562b81d34de214e9e8ac0f.tar.lz
go-tangerine-badaf43019dce961d6562b81d34de214e9e8ac0f.tar.xz
go-tangerine-badaf43019dce961d6562b81d34de214e9e8ac0f.tar.zst
go-tangerine-badaf43019dce961d6562b81d34de214e9e8ac0f.zip
les: remove redundant type specifiers (#19091)
-rw-r--r--les/fetcher_test.go11
-rw-r--r--les/peer_test.go14
2 files changed, 10 insertions, 15 deletions
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{}),