[lint] fix gofmt #708

pull/713/head
u5surf 6 years ago
parent bdbae9e23f
commit 4d09b63dff
  1. 4
      api/proto/node/node_test.go
  2. 6
      api/service/syncing/syncing_test.go
  3. 46
      internal/utils/configfile_test.go
  4. 12
      internal/utils/utils_test.go
  5. 8
      node/node_test.go

@ -55,8 +55,8 @@ func TestConstructTransactionListMessageAccount(t *testing.T) {
func TestConstructRequestTransactionsMessage(t *testing.T) {
txIDs := [][]byte{
[]byte{1, 2},
[]byte{3, 4},
{1, 2},
{3, 4},
}
buf := ConstructRequestTransactionsMessage(txIDs)

@ -10,7 +10,7 @@ import (
// Simple test for IncorrectResponse
func TestCreateTestSyncPeerConfig(t *testing.T) {
client := &downloader.Client{}
blockHashes := [][]byte{[]byte{}}
blockHashes := [][]byte{{}}
syncPeerConfig := CreateTestSyncPeerConfig(client, blockHashes)
assert.Equal(t, client, syncPeerConfig.GetClient(), "error")
}
@ -18,9 +18,9 @@ func TestCreateTestSyncPeerConfig(t *testing.T) {
// Simple test for IncorrectResponse
func TestCompareSyncPeerConfigByblockHashes(t *testing.T) {
client := &downloader.Client{}
blockHashes1 := [][]byte{[]byte{1, 2, 3}}
blockHashes1 := [][]byte{{1, 2, 3}}
syncPeerConfig1 := CreateTestSyncPeerConfig(client, blockHashes1)
blockHashes2 := [][]byte{[]byte{1, 2, 4}}
blockHashes2 := [][]byte{{1, 2, 4}}
syncPeerConfig2 := CreateTestSyncPeerConfig(client, blockHashes2)
// syncPeerConfig1 is less than syncPeerConfig2

@ -9,84 +9,84 @@ import (
func TestReadWalletProfile(t *testing.T) {
config := []*WalletProfile{
&WalletProfile{
{
Profile: "default",
Bootnodes: []string{"127.0.0.1:9000/abcd", "127.0.0.1:9999/daeg"},
Shards: 4,
RPCServer: [][]p2p.Peer{
[]p2p.Peer{
p2p.Peer{
{
{
IP: "127.0.0.4",
Port: "8888",
},
p2p.Peer{
{
IP: "192.168.0.4",
Port: "9876",
},
},
[]p2p.Peer{
p2p.Peer{
{
{
IP: "127.0.0.1",
Port: "8888",
},
p2p.Peer{
{
IP: "192.168.0.1",
Port: "9876",
},
},
[]p2p.Peer{
p2p.Peer{
{
{
IP: "127.0.0.2",
Port: "8888",
},
p2p.Peer{
{
IP: "192.168.0.2",
Port: "9876",
},
},
[]p2p.Peer{
p2p.Peer{
{
{
IP: "127.0.0.3",
Port: "8888",
},
p2p.Peer{
{
IP: "192.168.0.3",
Port: "9876",
},
},
},
},
&WalletProfile{
{
Profile: "testnet",
Bootnodes: []string{"192.168.0.1:9990/abcd", "127.0.0.1:8888/daeg"},
Shards: 3,
RPCServer: [][]p2p.Peer{
[]p2p.Peer{
p2p.Peer{
{
{
IP: "192.168.2.3",
Port: "8888",
},
p2p.Peer{
{
IP: "192.168.192.3",
Port: "9877",
},
},
[]p2p.Peer{
p2p.Peer{
{
{
IP: "192.168.2.1",
Port: "8888",
},
p2p.Peer{
{
IP: "192.168.192.1",
Port: "9877",
},
},
[]p2p.Peer{
p2p.Peer{
{
{
IP: "192.168.2.2",
Port: "8888",
},
p2p.Peer{
{
IP: "192.168.192.2",
Port: "9877",
},

@ -179,17 +179,17 @@ func TestStringsToPeers(t *testing.T) {
{
"127.0.0.1:9000,192.168.192.1:8888,54.32.12.3:9898",
[]p2p.Peer{
p2p.Peer{IP: "127.0.0.1", Port: "9000"},
p2p.Peer{IP: "192.168.192.1", Port: "8888"},
p2p.Peer{IP: "54.32.12.3", Port: "9898"},
{IP: "127.0.0.1", Port: "9000"},
{IP: "192.168.192.1", Port: "8888"},
{IP: "54.32.12.3", Port: "9898"},
},
},
{
"a:b,xx:XX,hello:world",
[]p2p.Peer{
p2p.Peer{IP: "a", Port: "b"},
p2p.Peer{IP: "xx", Port: "XX"},
p2p.Peer{IP: "hello", Port: "world"},
{IP: "a", Port: "b"},
{IP: "xx", Port: "XX"},
{IP: "hello", Port: "world"},
},
},
}

@ -79,12 +79,12 @@ func TestAddPeers(t *testing.T) {
pubKey2 := pki.GetBLSPrivateKeyFromInt(444).GetPublicKey()
peers1 := []*p2p.Peer{
&p2p.Peer{
{
IP: "127.0.0.1",
Port: "8888",
ConsensusPubKey: pubKey1,
},
&p2p.Peer{
{
IP: "127.0.0.1",
Port: "9999",
ConsensusPubKey: pubKey2,
@ -123,13 +123,13 @@ func TestAddBeaconPeer(t *testing.T) {
pubKey2 := bls2.RandPrivateKey().GetPublicKey()
peers1 := []*p2p.Peer{
&p2p.Peer{
{
IP: "127.0.0.1",
Port: "8888",
ConsensusPubKey: pubKey1,
PeerID: "1234",
},
&p2p.Peer{
{
IP: "127.0.0.1",
Port: "9999",
ConsensusPubKey: pubKey2,

Loading…
Cancel
Save