Fixed golint.

This commit is contained in:
parmarrushabh 2018-11-09 10:49:11 +05:30
parent 25f010b5ab
commit 3fc36efeb3
8 changed files with 13 additions and 13 deletions

View file

@ -35,6 +35,7 @@ import (
"github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind/backends" "github.com/ethereum/go-ethereum/accounts/abi/bind/backends"
blockSignerContract "github.com/ethereum/go-ethereum/contracts/blocksigner" blockSignerContract "github.com/ethereum/go-ethereum/contracts/blocksigner"
multiSignWalletContract "github.com/ethereum/go-ethereum/contracts/multisigwallet"
randomizeContract "github.com/ethereum/go-ethereum/contracts/randomize" randomizeContract "github.com/ethereum/go-ethereum/contracts/randomize"
validatorContract "github.com/ethereum/go-ethereum/contracts/validator" validatorContract "github.com/ethereum/go-ethereum/contracts/validator"
"github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto"

View file

@ -7,11 +7,11 @@ import (
"github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind/backends" "github.com/ethereum/go-ethereum/accounts/abi/bind/backends"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/consensus/XDPoS"
"github.com/ethereum/go-ethereum/contracts/blocksigner" "github.com/ethereum/go-ethereum/contracts/blocksigner"
"github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/consensus/XDPoS"
"math/big" "math/big"
"math/rand" "math/rand"
"testing" "testing"

View file

@ -366,7 +366,7 @@ func DeveloperGenesisBlock(period uint64, faucet common.Address) *Genesis {
common.BytesToAddress([]byte{6}): {Balance: big.NewInt(1)}, // ECAdd common.BytesToAddress([]byte{6}): {Balance: big.NewInt(1)}, // ECAdd
common.BytesToAddress([]byte{7}): {Balance: big.NewInt(1)}, // ECScalarMul common.BytesToAddress([]byte{7}): {Balance: big.NewInt(1)}, // ECScalarMul
common.BytesToAddress([]byte{8}): {Balance: big.NewInt(1)}, // ECPairing common.BytesToAddress([]byte{8}): {Balance: big.NewInt(1)}, // ECPairing
faucet: {Balance: new(big.Int).Sub(new(big.Int).Lsh(big.NewInt(1), 256), big.NewInt(9))}, faucet: {Balance: new(big.Int).Sub(new(big.Int).Lsh(big.NewInt(1), 256), big.NewInt(9))},
}, },
} }
} }

View file

@ -40,8 +40,8 @@ type PublicDownloaderAPI struct {
// installSyncSubscription channel. // installSyncSubscription channel.
func NewPublicDownloaderAPI(d *Downloader, m *event.TypeMux) *PublicDownloaderAPI { func NewPublicDownloaderAPI(d *Downloader, m *event.TypeMux) *PublicDownloaderAPI {
api := &PublicDownloaderAPI{ api := &PublicDownloaderAPI{
d: d, d: d,
mux: m, mux: m,
installSyncSubscription: make(chan chan interface{}), installSyncSubscription: make(chan chan interface{}),
uninstallSyncSubscription: make(chan *uninstallSyncSubscriptionRequest), uninstallSyncSubscription: make(chan *uninstallSyncSubscriptionRequest),
} }

View file

@ -669,7 +669,7 @@ func (f *Fetcher) insert(peer string, block *types.Block) {
go f.broadcastBlock(block, true) go f.broadcastBlock(block, true)
return return
} }
f.enqueue(peer,newBlock) f.enqueue(peer, newBlock)
return return
default: default:
// Something went very wrong, drop the peer // Something went very wrong, drop the peer

View file

@ -242,11 +242,10 @@ func testGetBlockBodies(t *testing.T, protocol int) {
available []bool // Availability of explicitly requested blocks available []bool // Availability of explicitly requested blocks
expected int // Total number of existing blocks to expect expected int // Total number of existing blocks to expect
}{ }{
{1, nil, nil, 1}, // A single random block should be retrievable {1, nil, nil, 1}, // A single random block should be retrievable
{10, nil, nil, 10}, // Multiple random blocks should be retrievable {10, nil, nil, 10}, // Multiple random blocks should be retrievable
{limit, nil, nil, limit}, // The maximum possible blocks should be retrievable {limit, nil, nil, limit}, // The maximum possible blocks should be retrievable
{limit + 1, nil, nil, limit}, // No more than the possible block count should be returned {limit + 1, nil, nil, limit}, // No more than the possible block count should be returned {0, []common.Hash{pm.blockchain.Genesis().Hash()}, []bool{true}, 1}, // The genesis block should be retrievable
{0, []common.Hash{pm.blockchain.Genesis().Hash()}, []bool{true}, 1}, // The genesis block should be retrievable
{0, []common.Hash{pm.blockchain.CurrentBlock().Hash()}, []bool{true}, 1}, // The chains head block should be retrievable {0, []common.Hash{pm.blockchain.CurrentBlock().Hash()}, []bool{true}, 1}, // The chains head block should be retrievable
{0, []common.Hash{{}}, []bool{false}, 0}, // A non existent block should not be returned {0, []common.Hash{{}}, []bool{false}, 0}, // A non existent block should not be returned

View file

@ -40,9 +40,9 @@ import (
) )
const ( const (
alpha = 3 // Kademlia concurrency factor alpha = 3 // Kademlia concurrency factor
bucketSize = 200 // Kademlia bucket size bucketSize = 200 // Kademlia bucket size
maxReplacements = 10 // Size of per-bucket replacement list maxReplacements = 10 // Size of per-bucket replacement list
// We keep buckets for the upper 1/15 of distances because // We keep buckets for the upper 1/15 of distances because
// it's very unlikely we'll ever encounter a node that's closer. // it's very unlikely we'll ever encounter a node that's closer.

View file

@ -71,7 +71,7 @@ func initErrHandling() {
multipleChoicesPage := GetMultipleChoicesErrorPage() multipleChoicesPage := GetMultipleChoicesErrorPage()
//map the codes to the available pages //map the codes to the available pages
tnames := map[int]string{ tnames := map[int]string{
0: genErrPage, //default 0: genErrPage, //default
http.StatusBadRequest: genErrPage, http.StatusBadRequest: genErrPage,
http.StatusNotFound: notFoundPage, http.StatusNotFound: notFoundPage,
http.StatusMultipleChoices: multipleChoicesPage, http.StatusMultipleChoices: multipleChoicesPage,