From c41a7cc5fad942091c52565785d9a85eb57912a7 Mon Sep 17 00:00:00 2001 From: Thomas Modeneis Date: Thu, 5 Apr 2018 13:59:49 +0200 Subject: [PATCH] fixing all linting errs add makefile for goimports -w run goimports add lint to travis build --- .travis.yml | 2 ++ Makefile | 5 +++- accounts/abi/bind/bind.go | 3 ++- accounts/abi/bind/bind_test.go | 3 ++- accounts/abi/event_test.go | 5 ++-- accounts/abi/type_test.go | 1 + accounts/abi/unpack_test.go | 3 ++- accounts/keystore/account_cache.go | 3 ++- accounts/keystore/account_cache_test.go | 1 + accounts/keystore/file_cache.go | 3 ++- accounts/keystore/key.go | 3 ++- accounts/keystore/keystore_passphrase.go | 7 ++--- accounts/keystore/presale.go | 5 ++-- accounts/keystore/watch.go | 3 ++- accounts/usbwallet/hub.go | 3 ++- accounts/usbwallet/ledger.go | 6 ++--- accounts/usbwallet/trezor.go | 3 ++- accounts/usbwallet/wallet.go | 3 ++- cmd/ethkey/generate.go | 5 ++-- cmd/ethkey/inspect.go | 3 ++- cmd/ethkey/main.go | 11 ++++---- cmd/ethkey/message.go | 3 ++- cmd/ethkey/run_test.go | 1 + cmd/ethkey/utils.go | 3 ++- cmd/evm/disasm.go | 3 ++- cmd/evm/main.go | 3 ++- cmd/evm/runner.go | 3 ++- cmd/faucet/faucet.go | 3 ++- cmd/geth/accountcmd.go | 3 ++- cmd/geth/bugcmd.go | 3 ++- cmd/geth/chaincmd.go | 5 ++-- cmd/geth/config.go | 3 ++- cmd/geth/consolecmd.go | 3 ++- cmd/geth/main.go | 3 ++- cmd/geth/misccmd.go | 3 ++- cmd/geth/monitorcmd.go | 5 ++-- cmd/geth/run_test.go | 1 + cmd/geth/usage.go | 3 ++- cmd/p2psim/main.go | 3 ++- cmd/puppeth/puppeth.go | 3 ++- cmd/puppeth/ssh.go | 3 ++- cmd/puppeth/wizard.go | 3 ++- cmd/puppeth/wizard_netstats.go | 3 ++- cmd/swarm/config.go | 3 ++- cmd/swarm/db.go | 3 ++- cmd/swarm/hash.go | 3 ++- cmd/swarm/list.go | 3 ++- cmd/swarm/manifest.go | 3 ++- cmd/swarm/run_test.go | 1 + cmd/swarm/upload.go | 3 ++- cmd/utils/customflags.go | 3 ++- cmd/utils/flags.go | 3 ++- cmd/wnode/main.go | 3 ++- consensus/clique/clique.go | 3 ++- consensus/clique/snapshot.go | 3 ++- consensus/consensus.go | 3 ++- consensus/ethash/consensus.go | 3 ++- consensus/ethash/ethash.go | 3 ++- console/bridge.go | 3 ++- console/console.go | 7 ++--- core/asm/compiler.go | 9 +++---- core/blockchain.go | 5 ++-- core/genesis_test.go | 1 + core/headerchain.go | 3 ++- core/state/database.go | 3 ++- core/state/state_test.go | 3 ++- core/tx_pool.go | 5 ++-- core/types/log_test.go | 1 + core/types/transaction.go | 2 +- core/vm/contracts.go | 3 ++- core/vm/instructions.go | 6 ++--- crypto/bn256/cloudflare/constants.go | 2 +- dashboard/dashboard.go | 3 ++- eth/api_test.go | 1 + eth/downloader/queue.go | 3 ++- eth/fetcher/fetcher.go | 3 ++- eth/peer.go | 3 ++- eth/tracers/tracer.go | 3 ++- ethdb/database.go | 5 ++-- ethstats/ethstats.go | 3 ++- internal/debug/flags.go | 5 ++-- internal/ethapi/api.go | 5 ++-- internal/jsre/jsre.go | 3 ++- les/bloombits.go | 12 ++++----- les/serverpool.go | 4 +-- les/sync.go | 4 +-- light/lightchain.go | 3 ++- light/trie_test.go | 1 + metrics/influxdb/influxdb.go | 3 ++- miner/worker.go | 3 ++- node/node.go | 3 ++- p2p/dial_test.go | 1 + p2p/discover/database.go | 7 ++--- p2p/discover/udp.go | 4 +-- p2p/discover/udp_test.go | 1 + p2p/discv5/database.go | 7 ++--- p2p/discv5/net.go | 7 ++--- p2p/discv5/table.go | 2 +- p2p/discv5/udp.go | 26 +++++++++---------- p2p/discv5/udp_test.go | 12 ++++----- p2p/enr/enr.go | 4 +-- p2p/enr/enr_test.go | 5 ++-- p2p/nat/nat.go | 3 ++- p2p/peer.go | 4 +-- p2p/rlpx.go | 3 ++- p2p/rlpx_test.go | 1 + p2p/simulations/adapters/docker.go | 1 + p2p/simulations/adapters/exec.go | 3 ++- p2p/simulations/adapters/types.go | 1 + p2p/simulations/http.go | 5 ++-- rpc/client_test.go | 1 + rpc/server.go | 3 ++- rpc/types.go | 3 ++- rpc/websocket.go | 3 ++- swarm/api/http/server.go | 3 ++- swarm/fuse/fuse_dir.go | 7 ++--- swarm/fuse/fuse_file.go | 3 ++- swarm/fuse/swarmfs.go | 3 ++- swarm/fuse/swarmfs_unix.go | 1 + swarm/metrics/flags.go | 3 ++- swarm/network/syncdb.go | 5 ++-- swarm/storage/database.go | 3 ++- swarm/storage/dbstore.go | 7 ++--- swarm/storage/netstore.go | 4 +-- trie/sync.go | 3 ++- trie/trie_test.go | 1 + .../robertkrimen/otto/ast/comments.go | 1 + vendor/github.com/robertkrimen/otto/result.go | 2 -- .../stretchr/testify/require/require.go | 3 ++- .../testify/require/require_forward.go | 3 ++- .../syndtr/goleveldb/leveldb/storage.go | 3 ++- .../x/crypto/openpgp/armor/armor.go | 3 ++- .../x/crypto/openpgp/packet/compressed.go | 3 ++- .../openpgp/packet/one_pass_signature.go | 5 ++-- .../x/crypto/openpgp/packet/packet.go | 5 ++-- .../x/crypto/openpgp/packet/reader.go | 3 ++- .../openpgp/packet/symmetrically_encrypted.go | 3 ++- .../x/crypto/ssh/terminal/util_solaris.go | 3 ++- vendor/gopkg.in/check.v1/benchmark.go | 6 ++--- whisper/mailserver/mailserver.go | 5 ++-- whisper/whisperv5/api.go | 2 +- whisper/whisperv5/peer.go | 3 ++- whisper/whisperv5/whisper.go | 9 ++++--- whisper/whisperv6/api.go | 2 +- whisper/whisperv6/api_test.go | 3 ++- whisper/whisperv6/benchmarks_test.go | 3 ++- whisper/whisperv6/peer.go | 3 ++- whisper/whisperv6/whisper.go | 9 ++++--- whisper/whisperv6/whisper_test.go | 3 ++- 149 files changed, 339 insertions(+), 209 deletions(-) diff --git a/.travis.yml b/.travis.yml index 40d940de0d..8a97bcd35e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,8 @@ matrix: - sudo chown root:$USER /etc/fuse.conf - go run build/ci.go install - go run build/ci.go test -coverage + - make install-linters + - make lint # These are the latest Go versions. - os: linux diff --git a/Makefile b/Makefile index 6766fd347f..a13fe497ba 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ ios: test: all build/env.sh go run build/ci.go test -lint: install-linters ## Run linters. Use make install-linters first. +lint: ## Run linters. Use make install-linters first. vendorcheck ./... gometalinter --disable-all -E vet -E goimports -E varcheck -E gofmt -E misspell -E goconst -E unconvert -E gosimple --deadline=10m --min-occurrences=6 --tests --vendor ./... @@ -46,6 +46,9 @@ install-linters: ## Install linters go get -u github.com/alecthomas/gometalinter gometalinter --vendored-linters --install +format: # Formats the code. Must have goimports installed (use make install-linters). + goimports -w -local github.com/ethereum/go-ethereum ./ + clean: rm -fr build/_workspace/pkg/ $(GOBIN)/* diff --git a/accounts/abi/bind/bind.go b/accounts/abi/bind/bind.go index 411177057b..6a5c609313 100644 --- a/accounts/abi/bind/bind.go +++ b/accounts/abi/bind/bind.go @@ -28,8 +28,9 @@ import ( "text/template" "unicode" - "github.com/ethereum/go-ethereum/accounts/abi" "golang.org/x/tools/imports" + + "github.com/ethereum/go-ethereum/accounts/abi" ) // Lang is a target programming language selector to generate bindings for. diff --git a/accounts/abi/bind/bind_test.go b/accounts/abi/bind/bind_test.go index 2a5a886487..5abad1c69d 100644 --- a/accounts/abi/bind/bind_test.go +++ b/accounts/abi/bind/bind_test.go @@ -26,8 +26,9 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/common" "golang.org/x/tools/imports" + + "github.com/ethereum/go-ethereum/common" ) var bindTests = []struct { diff --git a/accounts/abi/event_test.go b/accounts/abi/event_test.go index cca61e433d..c4498e9151 100644 --- a/accounts/abi/event_test.go +++ b/accounts/abi/event_test.go @@ -25,10 +25,11 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" ) var jsonEventTransfer = []byte(`{ diff --git a/accounts/abi/type_test.go b/accounts/abi/type_test.go index f6b36f18fd..fe74369374 100644 --- a/accounts/abi/type_test.go +++ b/accounts/abi/type_test.go @@ -22,6 +22,7 @@ import ( "testing" "github.com/davecgh/go-spew/spew" + "github.com/ethereum/go-ethereum/common" ) diff --git a/accounts/abi/unpack_test.go b/accounts/abi/unpack_test.go index bdbab10b4f..59d394a79f 100644 --- a/accounts/abi/unpack_test.go +++ b/accounts/abi/unpack_test.go @@ -26,8 +26,9 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" + + "github.com/ethereum/go-ethereum/common" ) type unpackTest struct { diff --git a/accounts/keystore/account_cache.go b/accounts/keystore/account_cache.go index 71f698ece7..95c4dec268 100644 --- a/accounts/keystore/account_cache.go +++ b/accounts/keystore/account_cache.go @@ -27,10 +27,11 @@ import ( "sync" "time" + "gopkg.in/fatih/set.v0" + "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" - "gopkg.in/fatih/set.v0" ) // Minimum amount of time between cache reloads. This limit applies if the platform does diff --git a/accounts/keystore/account_cache_test.go b/accounts/keystore/account_cache_test.go index fe9233c046..884c748915 100644 --- a/accounts/keystore/account_cache_test.go +++ b/accounts/keystore/account_cache_test.go @@ -29,6 +29,7 @@ import ( "github.com/cespare/cp" "github.com/davecgh/go-spew/spew" + "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/common" ) diff --git a/accounts/keystore/file_cache.go b/accounts/keystore/file_cache.go index c91b7b7b61..86aa765a34 100644 --- a/accounts/keystore/file_cache.go +++ b/accounts/keystore/file_cache.go @@ -24,8 +24,9 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/log" set "gopkg.in/fatih/set.v0" + + "github.com/ethereum/go-ethereum/log" ) // fileCache is a cache of files seen during scan of keystore. diff --git a/accounts/keystore/key.go b/accounts/keystore/key.go index 211fa863d7..65e956f3ea 100644 --- a/accounts/keystore/key.go +++ b/accounts/keystore/key.go @@ -29,10 +29,11 @@ import ( "strings" "time" + "github.com/pborman/uuid" + "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" - "github.com/pborman/uuid" ) const ( diff --git a/accounts/keystore/keystore_passphrase.go b/accounts/keystore/keystore_passphrase.go index eaec39f7df..76b77423a8 100644 --- a/accounts/keystore/keystore_passphrase.go +++ b/accounts/keystore/keystore_passphrase.go @@ -36,13 +36,14 @@ import ( "io/ioutil" "path/filepath" + "github.com/pborman/uuid" + "golang.org/x/crypto/pbkdf2" + "golang.org/x/crypto/scrypt" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/math" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/randentropy" - "github.com/pborman/uuid" - "golang.org/x/crypto/pbkdf2" - "golang.org/x/crypto/scrypt" ) const ( diff --git a/accounts/keystore/presale.go b/accounts/keystore/presale.go index 1554294e14..3c7550f386 100644 --- a/accounts/keystore/presale.go +++ b/accounts/keystore/presale.go @@ -25,10 +25,11 @@ import ( "errors" "fmt" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/crypto" "github.com/pborman/uuid" "golang.org/x/crypto/pbkdf2" + + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/crypto" ) // creates a Key and stores that in the given KeyStore by decrypting a presale key JSON diff --git a/accounts/keystore/watch.go b/accounts/keystore/watch.go index bbcfb99257..82c9b10e4a 100644 --- a/accounts/keystore/watch.go +++ b/accounts/keystore/watch.go @@ -21,8 +21,9 @@ package keystore import ( "time" - "github.com/ethereum/go-ethereum/log" "github.com/rjeczalik/notify" + + "github.com/ethereum/go-ethereum/log" ) type watcher struct { diff --git a/accounts/usbwallet/hub.go b/accounts/usbwallet/hub.go index 61fc98ccc8..1989a9e366 100644 --- a/accounts/usbwallet/hub.go +++ b/accounts/usbwallet/hub.go @@ -22,10 +22,11 @@ import ( "sync" "time" + "github.com/karalabe/hid" + "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/log" - "github.com/karalabe/hid" ) // LedgerScheme is the protocol scheme prefixing account and wallet URLs. diff --git a/accounts/usbwallet/ledger.go b/accounts/usbwallet/ledger.go index f5def61d23..9da72462a9 100644 --- a/accounts/usbwallet/ledger.go +++ b/accounts/usbwallet/ledger.go @@ -52,12 +52,12 @@ const ( ledgerOpSignTransaction ledgerOpcode = 0x04 // Signs an Ethereum transaction after having the user validate the parameters ledgerOpGetConfiguration ledgerOpcode = 0x06 // Returns specific wallet application configuration - ledgerP1DirectlyFetchAddress ledgerParam1 = 0x00 // Return address directly from the wallet - ledgerP1ConfirmFetchAddress ledgerParam1 = 0x01 // Require a user confirmation before returning the address + ledgerP1DirectlyFetchAddress ledgerParam1 = 0x00 // Return address directly from the wallet + //ledgerP1ConfirmFetchAddress ledgerParam1 = 0x01 // Require a user confirmation before returning the address ledgerP1InitTransactionData ledgerParam1 = 0x00 // First transaction data block for signing ledgerP1ContTransactionData ledgerParam1 = 0x80 // Subsequent transaction data block for signing ledgerP2DiscardAddressChainCode ledgerParam2 = 0x00 // Do not return the chain code along with the address - ledgerP2ReturnAddressChainCode ledgerParam2 = 0x01 // Require a user confirmation before returning the address + //ledgerP2ReturnAddressChainCode ledgerParam2 = 0x01 // Require a user confirmation before returning the address ) // errLedgerReplyInvalidHeader is the error message returned by a Ledger data exchange diff --git a/accounts/usbwallet/trezor.go b/accounts/usbwallet/trezor.go index b84a955992..35f7e6aa88 100644 --- a/accounts/usbwallet/trezor.go +++ b/accounts/usbwallet/trezor.go @@ -27,13 +27,14 @@ import ( "io" "math/big" + "github.com/golang/protobuf/proto" + "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts/usbwallet/internal/trezor" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/log" - "github.com/golang/protobuf/proto" ) // ErrTrezorPINNeeded is returned if opening the trezor requires a PIN code. In diff --git a/accounts/usbwallet/wallet.go b/accounts/usbwallet/wallet.go index 8b3b5a5224..30712dc5d2 100644 --- a/accounts/usbwallet/wallet.go +++ b/accounts/usbwallet/wallet.go @@ -25,12 +25,13 @@ import ( "sync" "time" + "github.com/karalabe/hid" + ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/log" - "github.com/karalabe/hid" ) // Maximum time between wallet health checks to detect USB unplugs. diff --git a/cmd/ethkey/generate.go b/cmd/ethkey/generate.go index 6d57d17fb4..b4d22613bd 100644 --- a/cmd/ethkey/generate.go +++ b/cmd/ethkey/generate.go @@ -23,11 +23,12 @@ import ( "os" "path/filepath" + "github.com/pborman/uuid" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/crypto" - "github.com/pborman/uuid" - "gopkg.in/urfave/cli.v1" ) type outputGenerate struct { diff --git a/cmd/ethkey/inspect.go b/cmd/ethkey/inspect.go index dbf5afc0ce..fdb7d2d95d 100644 --- a/cmd/ethkey/inspect.go +++ b/cmd/ethkey/inspect.go @@ -21,10 +21,11 @@ import ( "fmt" "io/ioutil" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/crypto" - "gopkg.in/urfave/cli.v1" ) type outputInspect struct { diff --git a/cmd/ethkey/main.go b/cmd/ethkey/main.go index 2a9e5ee483..17b4497396 100644 --- a/cmd/ethkey/main.go +++ b/cmd/ethkey/main.go @@ -20,8 +20,9 @@ import ( "fmt" "os" - "github.com/ethereum/go-ethereum/cmd/utils" "gopkg.in/urfave/cli.v1" + + "github.com/ethereum/go-ethereum/cmd/utils" ) const ( @@ -53,10 +54,10 @@ var ( Name: "json", Usage: "output JSON instead of human-readable format", } - messageFlag = cli.StringFlag{ - Name: "message", - Usage: "the file that contains the message to sign/verify", - } + //messageFlag = cli.StringFlag{ + // Name: "message", + // Usage: "the file that contains the message to sign/verify", + //} ) func main() { diff --git a/cmd/ethkey/message.go b/cmd/ethkey/message.go index 531a931c82..5535757d9f 100644 --- a/cmd/ethkey/message.go +++ b/cmd/ethkey/message.go @@ -21,11 +21,12 @@ import ( "fmt" "io/ioutil" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" - "gopkg.in/urfave/cli.v1" ) type outputSign struct { diff --git a/cmd/ethkey/run_test.go b/cmd/ethkey/run_test.go index 6006f6b5bb..857d3045ab 100644 --- a/cmd/ethkey/run_test.go +++ b/cmd/ethkey/run_test.go @@ -22,6 +22,7 @@ import ( "testing" "github.com/docker/docker/pkg/reexec" + "github.com/ethereum/go-ethereum/internal/cmdtest" ) diff --git a/cmd/ethkey/utils.go b/cmd/ethkey/utils.go index 0e563bf922..8f0f019fc6 100644 --- a/cmd/ethkey/utils.go +++ b/cmd/ethkey/utils.go @@ -22,10 +22,11 @@ import ( "io/ioutil" "strings" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/console" "github.com/ethereum/go-ethereum/crypto" - "gopkg.in/urfave/cli.v1" ) // getPassPhrase obtains a passphrase given by the user. It first checks the diff --git a/cmd/evm/disasm.go b/cmd/evm/disasm.go index 4a442cf784..19bc28e15a 100644 --- a/cmd/evm/disasm.go +++ b/cmd/evm/disasm.go @@ -22,8 +22,9 @@ import ( "io/ioutil" "strings" - "github.com/ethereum/go-ethereum/core/asm" cli "gopkg.in/urfave/cli.v1" + + "github.com/ethereum/go-ethereum/core/asm" ) var disasmCommand = cli.Command{ diff --git a/cmd/evm/main.go b/cmd/evm/main.go index a59cb1fb84..1994c08a18 100644 --- a/cmd/evm/main.go +++ b/cmd/evm/main.go @@ -22,8 +22,9 @@ import ( "math/big" "os" - "github.com/ethereum/go-ethereum/cmd/utils" "gopkg.in/urfave/cli.v1" + + "github.com/ethereum/go-ethereum/cmd/utils" ) var gitCommit = "" // Git SHA1 commit hash of the release (set via linker flags) diff --git a/cmd/evm/runner.go b/cmd/evm/runner.go index 8a7399840c..0e44e84aa5 100644 --- a/cmd/evm/runner.go +++ b/cmd/evm/runner.go @@ -27,6 +27,8 @@ import ( goruntime "runtime" + cli "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/cmd/evm/internal/compiler" "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/common" @@ -37,7 +39,6 @@ import ( "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/params" - cli "gopkg.in/urfave/cli.v1" ) var runCommand = cli.Command{ diff --git a/cmd/faucet/faucet.go b/cmd/faucet/faucet.go index 5bad09bbd5..9668813c03 100644 --- a/cmd/faucet/faucet.go +++ b/cmd/faucet/faucet.go @@ -41,6 +41,8 @@ import ( "sync" "time" + "golang.org/x/net/websocket" + "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/common" @@ -58,7 +60,6 @@ import ( "github.com/ethereum/go-ethereum/p2p/discv5" "github.com/ethereum/go-ethereum/p2p/nat" "github.com/ethereum/go-ethereum/params" - "golang.org/x/net/websocket" ) var ( diff --git a/cmd/geth/accountcmd.go b/cmd/geth/accountcmd.go index 0db5c4ce0f..2d6cd5ca95 100644 --- a/cmd/geth/accountcmd.go +++ b/cmd/geth/accountcmd.go @@ -20,13 +20,14 @@ import ( "fmt" "io/ioutil" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/console" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/log" - "gopkg.in/urfave/cli.v1" ) var ( diff --git a/cmd/geth/bugcmd.go b/cmd/geth/bugcmd.go index ce9dbe6c0a..ecfb7ffa22 100644 --- a/cmd/geth/bugcmd.go +++ b/cmd/geth/bugcmd.go @@ -29,8 +29,9 @@ import ( "github.com/ethereum/go-ethereum/cmd/internal/browser" "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/cmd/utils" cli "gopkg.in/urfave/cli.v1" + + "github.com/ethereum/go-ethereum/cmd/utils" ) var bugCommand = cli.Command{ diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index d3086921b9..9336c614f4 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -25,6 +25,9 @@ import ( "sync/atomic" "time" + "github.com/syndtr/goleveldb/leveldb/util" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/console" @@ -36,8 +39,6 @@ import ( "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/trie" - "github.com/syndtr/goleveldb/leveldb/util" - "gopkg.in/urfave/cli.v1" ) var ( diff --git a/cmd/geth/config.go b/cmd/geth/config.go index e6bd4d5bef..1cd9c6be98 100644 --- a/cmd/geth/config.go +++ b/cmd/geth/config.go @@ -27,13 +27,14 @@ import ( cli "gopkg.in/urfave/cli.v1" + "github.com/naoina/toml" + "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/dashboard" "github.com/ethereum/go-ethereum/eth" "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/params" whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" - "github.com/naoina/toml" ) var ( diff --git a/cmd/geth/consolecmd.go b/cmd/geth/consolecmd.go index 2500a969cf..9d52f27dbf 100644 --- a/cmd/geth/consolecmd.go +++ b/cmd/geth/consolecmd.go @@ -24,11 +24,12 @@ import ( "strings" "syscall" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/console" "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/rpc" - "gopkg.in/urfave/cli.v1" ) var ( diff --git a/cmd/geth/main.go b/cmd/geth/main.go index d94154245f..3bccb0666b 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -25,6 +25,8 @@ import ( "strings" "time" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/cmd/utils" @@ -35,7 +37,6 @@ import ( "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/node" - "gopkg.in/urfave/cli.v1" ) const ( diff --git a/cmd/geth/misccmd.go b/cmd/geth/misccmd.go index aa9b1ee568..3106075808 100644 --- a/cmd/geth/misccmd.go +++ b/cmd/geth/misccmd.go @@ -23,11 +23,12 @@ import ( "strconv" "strings" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/consensus/ethash" "github.com/ethereum/go-ethereum/eth" "github.com/ethereum/go-ethereum/params" - "gopkg.in/urfave/cli.v1" ) var ( diff --git a/cmd/geth/monitorcmd.go b/cmd/geth/monitorcmd.go index cd19caa276..5f0f5cbd67 100644 --- a/cmd/geth/monitorcmd.go +++ b/cmd/geth/monitorcmd.go @@ -25,11 +25,12 @@ import ( "strings" "time" + "github.com/gizak/termui" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/rpc" - "github.com/gizak/termui" - "gopkg.in/urfave/cli.v1" ) var ( diff --git a/cmd/geth/run_test.go b/cmd/geth/run_test.go index da82facac3..f94050124a 100644 --- a/cmd/geth/run_test.go +++ b/cmd/geth/run_test.go @@ -23,6 +23,7 @@ import ( "testing" "github.com/docker/docker/pkg/reexec" + "github.com/ethereum/go-ethereum/internal/cmdtest" ) diff --git a/cmd/geth/usage.go b/cmd/geth/usage.go index a1558c2330..5378bdc935 100644 --- a/cmd/geth/usage.go +++ b/cmd/geth/usage.go @@ -24,9 +24,10 @@ import ( "strings" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/internal/debug" - "gopkg.in/urfave/cli.v1" ) // AppHelpTemplate is the test template for the default, global app help topic. diff --git a/cmd/p2psim/main.go b/cmd/p2psim/main.go index 0c8ed038d5..38a54add4e 100644 --- a/cmd/p2psim/main.go +++ b/cmd/p2psim/main.go @@ -45,13 +45,14 @@ import ( "strings" "text/tabwriter" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/p2p/discover" "github.com/ethereum/go-ethereum/p2p/simulations" "github.com/ethereum/go-ethereum/p2p/simulations/adapters" "github.com/ethereum/go-ethereum/rpc" - "gopkg.in/urfave/cli.v1" ) var client *simulations.Client diff --git a/cmd/puppeth/puppeth.go b/cmd/puppeth/puppeth.go index f9b8fe4811..9328f5280b 100644 --- a/cmd/puppeth/puppeth.go +++ b/cmd/puppeth/puppeth.go @@ -23,8 +23,9 @@ import ( "strings" "time" - "github.com/ethereum/go-ethereum/log" "gopkg.in/urfave/cli.v1" + + "github.com/ethereum/go-ethereum/log" ) // main is just a boring entry point to set up the CLI app. diff --git a/cmd/puppeth/ssh.go b/cmd/puppeth/ssh.go index 158261ce05..ffc1488336 100644 --- a/cmd/puppeth/ssh.go +++ b/cmd/puppeth/ssh.go @@ -28,9 +28,10 @@ import ( "path/filepath" "strings" - "github.com/ethereum/go-ethereum/log" "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/terminal" + + "github.com/ethereum/go-ethereum/log" ) // sshClient is a small wrapper around Go's SSH client with a few utility methods diff --git a/cmd/puppeth/wizard.go b/cmd/puppeth/wizard.go index b88a61de7d..09f67809fe 100644 --- a/cmd/puppeth/wizard.go +++ b/cmd/puppeth/wizard.go @@ -30,10 +30,11 @@ import ( "strings" "sync" + "golang.org/x/crypto/ssh/terminal" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/log" - "golang.org/x/crypto/ssh/terminal" ) // config contains all the configurations needed by puppeth that should be saved diff --git a/cmd/puppeth/wizard_netstats.go b/cmd/puppeth/wizard_netstats.go index 90bf7ae3c8..3c02925054 100644 --- a/cmd/puppeth/wizard_netstats.go +++ b/cmd/puppeth/wizard_netstats.go @@ -23,9 +23,10 @@ import ( "strings" "sync" + "github.com/olekukonko/tablewriter" + "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/log" - "github.com/olekukonko/tablewriter" ) // networkStats verifies the status of network components and generates a protip diff --git a/cmd/swarm/config.go b/cmd/swarm/config.go index adac772bab..bfd1a3d961 100644 --- a/cmd/swarm/config.go +++ b/cmd/swarm/config.go @@ -28,11 +28,12 @@ import ( cli "gopkg.in/urfave/cli.v1" + "github.com/naoina/toml" + "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/node" - "github.com/naoina/toml" bzzapi "github.com/ethereum/go-ethereum/swarm/api" ) diff --git a/cmd/swarm/db.go b/cmd/swarm/db.go index dfd2d069b9..4ea97af75c 100644 --- a/cmd/swarm/db.go +++ b/cmd/swarm/db.go @@ -22,10 +22,11 @@ import ( "os" "path/filepath" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/swarm/storage" - "gopkg.in/urfave/cli.v1" ) func dbExport(ctx *cli.Context) { diff --git a/cmd/swarm/hash.go b/cmd/swarm/hash.go index 792e8d0d7a..b89de1df09 100644 --- a/cmd/swarm/hash.go +++ b/cmd/swarm/hash.go @@ -21,9 +21,10 @@ import ( "fmt" "os" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/swarm/storage" - "gopkg.in/urfave/cli.v1" ) func hash(ctx *cli.Context) { diff --git a/cmd/swarm/list.go b/cmd/swarm/list.go index 57b5517c6e..a4dd422187 100644 --- a/cmd/swarm/list.go +++ b/cmd/swarm/list.go @@ -22,9 +22,10 @@ import ( "strings" "text/tabwriter" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/cmd/utils" swarm "github.com/ethereum/go-ethereum/swarm/api/client" - "gopkg.in/urfave/cli.v1" ) func list(ctx *cli.Context) { diff --git a/cmd/swarm/manifest.go b/cmd/swarm/manifest.go index 41a69a5d05..f286a7e056 100644 --- a/cmd/swarm/manifest.go +++ b/cmd/swarm/manifest.go @@ -24,10 +24,11 @@ import ( "path/filepath" "strings" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/swarm/api" swarm "github.com/ethereum/go-ethereum/swarm/api/client" - "gopkg.in/urfave/cli.v1" ) const bzzManifestJSON = "application/bzz-manifest+json" diff --git a/cmd/swarm/run_test.go b/cmd/swarm/run_test.go index 594cfa55cb..76310e2fa0 100644 --- a/cmd/swarm/run_test.go +++ b/cmd/swarm/run_test.go @@ -27,6 +27,7 @@ import ( "time" "github.com/docker/docker/pkg/reexec" + "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/internal/cmdtest" diff --git a/cmd/swarm/upload.go b/cmd/swarm/upload.go index 9f4c525bb9..b0d587129f 100644 --- a/cmd/swarm/upload.go +++ b/cmd/swarm/upload.go @@ -30,9 +30,10 @@ import ( "path/filepath" "strings" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/cmd/utils" swarm "github.com/ethereum/go-ethereum/swarm/api/client" - "gopkg.in/urfave/cli.v1" ) func upload(ctx *cli.Context) { diff --git a/cmd/utils/customflags.go b/cmd/utils/customflags.go index e5bf8724c1..06de36666a 100644 --- a/cmd/utils/customflags.go +++ b/cmd/utils/customflags.go @@ -27,8 +27,9 @@ import ( "path" "strings" - "github.com/ethereum/go-ethereum/common/math" "gopkg.in/urfave/cli.v1" + + "github.com/ethereum/go-ethereum/common/math" ) // Custom type which is registered in the flags library which cli uses for diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 4f3d81f5d2..dadac12d28 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -28,6 +28,8 @@ import ( "strconv" "strings" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/common" @@ -56,7 +58,6 @@ import ( "github.com/ethereum/go-ethereum/p2p/netutil" "github.com/ethereum/go-ethereum/params" whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" - "gopkg.in/urfave/cli.v1" ) var ( diff --git a/cmd/wnode/main.go b/cmd/wnode/main.go index 988c50ce3d..6aeeb1bbe3 100644 --- a/cmd/wnode/main.go +++ b/cmd/wnode/main.go @@ -35,6 +35,8 @@ import ( "strings" "time" + "golang.org/x/crypto/pbkdf2" + "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/console" @@ -45,7 +47,6 @@ import ( "github.com/ethereum/go-ethereum/p2p/nat" "github.com/ethereum/go-ethereum/whisper/mailserver" whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" - "golang.org/x/crypto/pbkdf2" ) const quitCommand = "~Q" diff --git a/consensus/clique/clique.go b/consensus/clique/clique.go index 2bdad9092a..22476d94fb 100644 --- a/consensus/clique/clique.go +++ b/consensus/clique/clique.go @@ -25,6 +25,8 @@ import ( "sync" "time" + lru "github.com/hashicorp/golang-lru" + "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" @@ -39,7 +41,6 @@ import ( "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/rpc" - lru "github.com/hashicorp/golang-lru" ) const ( diff --git a/consensus/clique/snapshot.go b/consensus/clique/snapshot.go index 9ebdb8df15..d71ced007f 100644 --- a/consensus/clique/snapshot.go +++ b/consensus/clique/snapshot.go @@ -20,11 +20,12 @@ import ( "bytes" "encoding/json" + lru "github.com/hashicorp/golang-lru" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/params" - lru "github.com/hashicorp/golang-lru" ) // Vote represents a single vote that an authorized signer made to modify the diff --git a/consensus/consensus.go b/consensus/consensus.go index be5e661c12..5774af1a78 100644 --- a/consensus/consensus.go +++ b/consensus/consensus.go @@ -18,12 +18,13 @@ package consensus import ( + "math/big" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rpc" - "math/big" ) // ChainReader defines a small collection of methods needed to access the local diff --git a/consensus/ethash/consensus.go b/consensus/ethash/consensus.go index 99eec82211..477019c51d 100644 --- a/consensus/ethash/consensus.go +++ b/consensus/ethash/consensus.go @@ -24,6 +24,8 @@ import ( "runtime" "time" + set "gopkg.in/fatih/set.v0" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/math" "github.com/ethereum/go-ethereum/consensus" @@ -31,7 +33,6 @@ import ( "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/params" - set "gopkg.in/fatih/set.v0" ) // Ethash proof-of-work protocol constants. diff --git a/consensus/ethash/ethash.go b/consensus/ethash/ethash.go index 1b3dcee302..ba56fb92ea 100644 --- a/consensus/ethash/ethash.go +++ b/consensus/ethash/ethash.go @@ -33,11 +33,12 @@ import ( "unsafe" mmap "github.com/edsrzf/mmap-go" + "github.com/hashicorp/golang-lru/simplelru" + "github.com/ethereum/go-ethereum/consensus" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/rpc" - "github.com/hashicorp/golang-lru/simplelru" ) var ErrInvalidDumpMagic = errors.New("invalid dump magic") diff --git a/console/bridge.go b/console/bridge.go index b28cc438e2..dd12f797e0 100644 --- a/console/bridge.go +++ b/console/bridge.go @@ -23,10 +23,11 @@ import ( "strings" "time" + "github.com/robertkrimen/otto" + "github.com/ethereum/go-ethereum/accounts/usbwallet" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/rpc" - "github.com/robertkrimen/otto" ) // bridge is a collection of JavaScript utility methods to bride the .js runtime diff --git a/console/console.go b/console/console.go index b280d4e65d..cef5d3c7be 100644 --- a/console/console.go +++ b/console/console.go @@ -28,12 +28,13 @@ import ( "strings" "syscall" - "github.com/ethereum/go-ethereum/internal/jsre" - "github.com/ethereum/go-ethereum/internal/web3ext" - "github.com/ethereum/go-ethereum/rpc" "github.com/mattn/go-colorable" "github.com/peterh/liner" "github.com/robertkrimen/otto" + + "github.com/ethereum/go-ethereum/internal/jsre" + "github.com/ethereum/go-ethereum/internal/web3ext" + "github.com/ethereum/go-ethereum/rpc" ) var ( diff --git a/core/asm/compiler.go b/core/asm/compiler.go index 18dc0877ff..abe2992a92 100644 --- a/core/asm/compiler.go +++ b/core/asm/compiler.go @@ -17,7 +17,6 @@ package asm import ( - "errors" "fmt" "math/big" "os" @@ -264,10 +263,10 @@ func (err compileError) Error() string { return fmt.Sprintf("%d syntax error: unexpected %v, expected %v", err.lineno, err.got, err.want) } -var ( - errExpBol = errors.New("expected beginning of line") - errExpElementOrLabel = errors.New("expected beginning of line") -) +//var ( +// errExpBol = errors.New("expected beginning of line") +// errExpElementOrLabel = errors.New("expected beginning of line") +//) func compileErr(c token, got, want string) error { return compileError{ diff --git a/core/blockchain.go b/core/blockchain.go index b33eb85a44..48bbf220ee 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -27,6 +27,9 @@ import ( "sync/atomic" "time" + "github.com/hashicorp/golang-lru" + "gopkg.in/karalabe/cookiejar.v2/collections/prque" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/mclock" "github.com/ethereum/go-ethereum/consensus" @@ -41,8 +44,6 @@ import ( "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/trie" - "github.com/hashicorp/golang-lru" - "gopkg.in/karalabe/cookiejar.v2/collections/prque" ) var ( diff --git a/core/genesis_test.go b/core/genesis_test.go index 052ded6991..48845c1286 100644 --- a/core/genesis_test.go +++ b/core/genesis_test.go @@ -22,6 +22,7 @@ import ( "testing" "github.com/davecgh/go-spew/spew" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus/ethash" "github.com/ethereum/go-ethereum/core/vm" diff --git a/core/headerchain.go b/core/headerchain.go index 2d1b0a2a18..70dfe6dd20 100644 --- a/core/headerchain.go +++ b/core/headerchain.go @@ -26,13 +26,14 @@ import ( "sync/atomic" "time" + "github.com/hashicorp/golang-lru" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/params" - "github.com/hashicorp/golang-lru" ) const ( diff --git a/core/state/database.go b/core/state/database.go index c1b630991c..8bf8b9b411 100644 --- a/core/state/database.go +++ b/core/state/database.go @@ -20,10 +20,11 @@ import ( "fmt" "sync" + lru "github.com/hashicorp/golang-lru" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/trie" - lru "github.com/hashicorp/golang-lru" ) // Trie cache generation limit after which to evict trie nodes from memory. diff --git a/core/state/state_test.go b/core/state/state_test.go index 6d42d63d82..5e527fc115 100644 --- a/core/state/state_test.go +++ b/core/state/state_test.go @@ -21,10 +21,11 @@ import ( "math/big" "testing" + checker "gopkg.in/check.v1" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethdb" - checker "gopkg.in/check.v1" ) type StateSuite struct { diff --git a/core/tx_pool.go b/core/tx_pool.go index 089bd215ad..8db43e811c 100644 --- a/core/tx_pool.go +++ b/core/tx_pool.go @@ -25,6 +25,8 @@ import ( "sync" "time" + "gopkg.in/karalabe/cookiejar.v2/collections/prque" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" @@ -32,14 +34,13 @@ import ( "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/params" - "gopkg.in/karalabe/cookiejar.v2/collections/prque" ) const ( // chainHeadChanSize is the size of channel listening to ChainHeadEvent. chainHeadChanSize = 10 // rmTxChanSize is the size of channel listening to RemovedTransactionEvent. - rmTxChanSize = 10 + //rmTxChanSize = 10 ) var ( diff --git a/core/types/log_test.go b/core/types/log_test.go index 0e56acfe4a..bbe872b664 100644 --- a/core/types/log_test.go +++ b/core/types/log_test.go @@ -23,6 +23,7 @@ import ( "testing" "github.com/davecgh/go-spew/spew" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" ) diff --git a/core/types/transaction.go b/core/types/transaction.go index 5660582baf..2cb6612d48 100644 --- a/core/types/transaction.go +++ b/core/types/transaction.go @@ -34,7 +34,7 @@ import ( var ( ErrInvalidSig = errors.New("invalid transaction v, r, s values") - errNoSigner = errors.New("missing signing methods") + //errNoSigner = errors.New("missing signing methods") ) // deriveSigner makes a *best* guess about which signer to use. diff --git a/core/vm/contracts.go b/core/vm/contracts.go index 237450ea96..237ac18d7d 100644 --- a/core/vm/contracts.go +++ b/core/vm/contracts.go @@ -21,12 +21,13 @@ import ( "errors" "math/big" + "golang.org/x/crypto/ripemd160" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/math" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/bn256" "github.com/ethereum/go-ethereum/params" - "golang.org/x/crypto/ripemd160" ) // PrecompiledContract is the basic interface for native Go contracts. The implementation diff --git a/core/vm/instructions.go b/core/vm/instructions.go index 1e494a0eb8..bcb8c40bfa 100644 --- a/core/vm/instructions.go +++ b/core/vm/instructions.go @@ -29,9 +29,9 @@ import ( ) var ( - bigZero = new(big.Int) - tt255 = math.BigPow(2, 255) - tt256 = math.BigPow(2, 256) + bigZero = new(big.Int) + tt255 = math.BigPow(2, 255) + //tt256 = math.BigPow(2, 256) errWriteProtection = errors.New("evm: write protection") errReturnDataOutOfBounds = errors.New("evm: return data out of bounds") errExecutionReverted = errors.New("evm: execution reverted") diff --git a/crypto/bn256/cloudflare/constants.go b/crypto/bn256/cloudflare/constants.go index 5122aae64f..97874bb760 100644 --- a/crypto/bn256/cloudflare/constants.go +++ b/crypto/bn256/cloudflare/constants.go @@ -26,7 +26,7 @@ var P = bigFromBase10("218882428718392752222464057452572750886963111572978236626 var p2 = [4]uint64{0x3c208c16d87cfd47, 0x97816a916871ca8d, 0xb85045b68181585d, 0x30644e72e131a029} // np is the negative inverse of p, mod 2^256. -var np = [4]uint64{0x87d20782e4866389, 0x9ede7d651eca6ac9, 0xd8afcbd01833da80, 0xf57a22b791888c6b} +//var np = [4]uint64{0x87d20782e4866389, 0x9ede7d651eca6ac9, 0xd8afcbd01833da80, 0xf57a22b791888c6b} // rN1 is R^-1 where R = 2^256 mod p. var rN1 = &gfP{0xed84884a014afa37, 0xeb2022850278edf8, 0xcf63e9cfb74492d9, 0x2e67157159e5c639} diff --git a/dashboard/dashboard.go b/dashboard/dashboard.go index 399fa34c08..bc222123a8 100644 --- a/dashboard/dashboard.go +++ b/dashboard/dashboard.go @@ -33,12 +33,13 @@ import ( "time" "github.com/elastic/gosigar" + "golang.org/x/net/websocket" + "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rpc" - "golang.org/x/net/websocket" ) const ( diff --git a/eth/api_test.go b/eth/api_test.go index 900a82bb6a..99d8e3bbff 100644 --- a/eth/api_test.go +++ b/eth/api_test.go @@ -21,6 +21,7 @@ import ( "testing" "github.com/davecgh/go-spew/spew" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/ethdb" diff --git a/eth/downloader/queue.go b/eth/downloader/queue.go index bbe0aed5dc..cd065caf1e 100644 --- a/eth/downloader/queue.go +++ b/eth/downloader/queue.go @@ -25,11 +25,12 @@ import ( "sync" "time" + "gopkg.in/karalabe/cookiejar.v2/collections/prque" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/metrics" - "gopkg.in/karalabe/cookiejar.v2/collections/prque" ) var ( diff --git a/eth/fetcher/fetcher.go b/eth/fetcher/fetcher.go index 0c679cec3a..7e2077b462 100644 --- a/eth/fetcher/fetcher.go +++ b/eth/fetcher/fetcher.go @@ -22,11 +22,12 @@ import ( "math/rand" "time" + "gopkg.in/karalabe/cookiejar.v2/collections/prque" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/log" - "gopkg.in/karalabe/cookiejar.v2/collections/prque" ) const ( diff --git a/eth/peer.go b/eth/peer.go index 42ead53965..72f1f0e813 100644 --- a/eth/peer.go +++ b/eth/peer.go @@ -23,11 +23,12 @@ import ( "sync" "time" + "gopkg.in/fatih/set.v0" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/rlp" - "gopkg.in/fatih/set.v0" ) var ( diff --git a/eth/tracers/tracer.go b/eth/tracers/tracer.go index 4cec9e633c..4305148837 100644 --- a/eth/tracers/tracer.go +++ b/eth/tracers/tracer.go @@ -25,12 +25,13 @@ import ( "time" "unsafe" + duktape "gopkg.in/olebedev/go-duktape.v3" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/log" - duktape "gopkg.in/olebedev/go-duktape.v3" ) // bigIntegerJS is the minified version of https://github.com/peterolson/BigInteger.js. diff --git a/ethdb/database.go b/ethdb/database.go index 30ed37dc7b..f4ac51622a 100644 --- a/ethdb/database.go +++ b/ethdb/database.go @@ -22,14 +22,15 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/errors" "github.com/syndtr/goleveldb/leveldb/filter" "github.com/syndtr/goleveldb/leveldb/iterator" "github.com/syndtr/goleveldb/leveldb/opt" "github.com/syndtr/goleveldb/leveldb/util" + + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/metrics" ) var OpenFileLimit = 64 diff --git a/ethstats/ethstats.go b/ethstats/ethstats.go index ae7e252654..d290fd615d 100644 --- a/ethstats/ethstats.go +++ b/ethstats/ethstats.go @@ -30,6 +30,8 @@ import ( "strings" "time" + "golang.org/x/net/websocket" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/mclock" "github.com/ethereum/go-ethereum/consensus" @@ -41,7 +43,6 @@ import ( "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/rpc" - "golang.org/x/net/websocket" ) const ( diff --git a/internal/debug/flags.go b/internal/debug/flags.go index 1f181bf8b0..2ef0e07022 100644 --- a/internal/debug/flags.go +++ b/internal/debug/flags.go @@ -24,12 +24,13 @@ import ( "os" "runtime" + colorable "github.com/mattn/go-colorable" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log/term" "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/metrics/exp" - colorable "github.com/mattn/go-colorable" - "gopkg.in/urfave/cli.v1" ) var ( diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 6525aa212c..dc39e09c1d 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -25,6 +25,9 @@ import ( "strings" "time" + "github.com/syndtr/goleveldb/leveldb" + "github.com/syndtr/goleveldb/leveldb/util" + "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/common" @@ -40,8 +43,6 @@ import ( "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/rpc" - "github.com/syndtr/goleveldb/leveldb" - "github.com/syndtr/goleveldb/leveldb/util" ) const ( diff --git a/internal/jsre/jsre.go b/internal/jsre/jsre.go index f05865eca6..b8079b2137 100644 --- a/internal/jsre/jsre.go +++ b/internal/jsre/jsre.go @@ -26,9 +26,10 @@ import ( "math/rand" "time" + "github.com/robertkrimen/otto" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/internal/jsre/deps" - "github.com/robertkrimen/otto" ) var ( diff --git a/les/bloombits.go b/les/bloombits.go index de233d7518..900b7a7af0 100644 --- a/les/bloombits.go +++ b/les/bloombits.go @@ -74,11 +74,11 @@ func (eth *LightEthereum) startBloomHandlers() { } const ( - // bloomConfirms is the number of confirmation blocks before a bloom section is - // considered probably final and its rotated bits are calculated. - bloomConfirms = 256 +// bloomConfirms is the number of confirmation blocks before a bloom section is +// considered probably final and its rotated bits are calculated. +//bloomConfirms = 256 - // bloomThrottling is the time to wait between processing two consecutive index - // sections. It's useful during chain upgrades to prevent disk overload. - bloomThrottling = 100 * time.Millisecond +// bloomThrottling is the time to wait between processing two consecutive index +// sections. It's useful during chain upgrades to prevent disk overload. +//bloomThrottling = 100 * time.Millisecond ) diff --git a/les/serverpool.go b/les/serverpool.go index a84c29c3ac..a87d8d18af 100644 --- a/les/serverpool.go +++ b/les/serverpool.go @@ -73,7 +73,7 @@ const ( // and a short term value which is adjusted exponentially with a factor of // pstatRecentAdjust with each dial/connection and also returned exponentially // to the average with the time constant pstatReturnToMeanTC - pstatRecentAdjust = 0.1 + //pstatRecentAdjust = 0.1 pstatReturnToMeanTC = time.Hour // node address selection weight is dropped by a factor of exp(-addrFailDropLn) after // each unsuccessful connection (restored after a successful one) @@ -85,7 +85,7 @@ const ( timeoutPow = 10 // peerSelectMinWeight is added to calculated weights at request peer selection // to give poorly performing peers a little chance of coming back - peerSelectMinWeight = 0.005 + //peerSelectMinWeight = 0.005 // initStatsWeight is used to initialize previously unknown peers with good // statistics to give a chance to prove themselves initStatsWeight = 1 diff --git a/les/sync.go b/les/sync.go index c0e17f97d9..22825b1e05 100644 --- a/les/sync.go +++ b/les/sync.go @@ -26,8 +26,8 @@ import ( ) const ( - //forceSyncCycle = 10 * time.Second // Time interval to force syncs, even if few peers are available - minDesiredPeerCount = 5 // Amount of peers desired to start syncing +//forceSyncCycle = 10 * time.Second // Time interval to force syncs, even if few peers are available +//minDesiredPeerCount = 5 // Amount of peers desired to start syncing ) // syncer is responsible for periodically synchronising with the network, both diff --git a/light/lightchain.go b/light/lightchain.go index 2784615d35..e2538b9ac6 100644 --- a/light/lightchain.go +++ b/light/lightchain.go @@ -24,6 +24,8 @@ import ( "sync/atomic" "time" + "github.com/hashicorp/golang-lru" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus" "github.com/ethereum/go-ethereum/core" @@ -34,7 +36,6 @@ import ( "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rlp" - "github.com/hashicorp/golang-lru" ) var ( diff --git a/light/trie_test.go b/light/trie_test.go index 0d6b2cc1d8..876caa9ed7 100644 --- a/light/trie_test.go +++ b/light/trie_test.go @@ -23,6 +23,7 @@ import ( "testing" "github.com/davecgh/go-spew/spew" + "github.com/ethereum/go-ethereum/consensus/ethash" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/state" diff --git a/metrics/influxdb/influxdb.go b/metrics/influxdb/influxdb.go index d5cb4da66f..94f5ec4e4f 100644 --- a/metrics/influxdb/influxdb.go +++ b/metrics/influxdb/influxdb.go @@ -6,8 +6,9 @@ import ( uurl "net/url" "time" - "github.com/ethereum/go-ethereum/metrics" "github.com/influxdata/influxdb/client" + + "github.com/ethereum/go-ethereum/metrics" ) type reporter struct { diff --git a/miner/worker.go b/miner/worker.go index 15395ae0b9..1a301bf074 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -24,6 +24,8 @@ import ( "sync/atomic" "time" + "gopkg.in/fatih/set.v0" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus" "github.com/ethereum/go-ethereum/consensus/misc" @@ -35,7 +37,6 @@ import ( "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/params" - "gopkg.in/fatih/set.v0" ) const ( diff --git a/node/node.go b/node/node.go index b02aecfad1..eebbd92401 100644 --- a/node/node.go +++ b/node/node.go @@ -26,6 +26,8 @@ import ( "strings" "sync" + "github.com/prometheus/prometheus/util/flock" + "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/event" @@ -33,7 +35,6 @@ import ( "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/rpc" - "github.com/prometheus/prometheus/util/flock" ) // Node is a container on which services can be registered. diff --git a/p2p/dial_test.go b/p2p/dial_test.go index 2a7941fc65..603021e823 100644 --- a/p2p/dial_test.go +++ b/p2p/dial_test.go @@ -24,6 +24,7 @@ import ( "time" "github.com/davecgh/go-spew/spew" + "github.com/ethereum/go-ethereum/p2p/discover" "github.com/ethereum/go-ethereum/p2p/netutil" ) diff --git a/p2p/discover/database.go b/p2p/discover/database.go index 6f98de9b42..0b856d68c6 100644 --- a/p2p/discover/database.go +++ b/p2p/discover/database.go @@ -27,15 +27,16 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/errors" "github.com/syndtr/goleveldb/leveldb/iterator" "github.com/syndtr/goleveldb/leveldb/opt" "github.com/syndtr/goleveldb/leveldb/storage" "github.com/syndtr/goleveldb/leveldb/util" + + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/rlp" ) var ( diff --git a/p2p/discover/udp.go b/p2p/discover/udp.go index 524c6e4988..f585452f47 100644 --- a/p2p/discover/udp.go +++ b/p2p/discover/udp.go @@ -49,8 +49,8 @@ var ( // Timeouts const ( respTimeout = 500 * time.Millisecond - sendTimeout = 500 * time.Millisecond - expiration = 20 * time.Second + //sendTimeout = 500 * time.Millisecond + expiration = 20 * time.Second ntpFailureThreshold = 32 // Continuous timeouts after which to check NTP ntpWarningCooldown = 10 * time.Minute // Minimum amount of time to pass before repeating NTP warning diff --git a/p2p/discover/udp_test.go b/p2p/discover/udp_test.go index db9804f7bc..817b6e26f4 100644 --- a/p2p/discover/udp_test.go +++ b/p2p/discover/udp_test.go @@ -34,6 +34,7 @@ import ( "time" "github.com/davecgh/go-spew/spew" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/rlp" diff --git a/p2p/discv5/database.go b/p2p/discv5/database.go index 3c2d5744c3..514ae49ef0 100644 --- a/p2p/discv5/database.go +++ b/p2p/discv5/database.go @@ -28,15 +28,16 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/errors" "github.com/syndtr/goleveldb/leveldb/iterator" "github.com/syndtr/goleveldb/leveldb/opt" "github.com/syndtr/goleveldb/leveldb/storage" "github.com/syndtr/goleveldb/leveldb/util" + + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/rlp" ) var ( diff --git a/p2p/discv5/net.go b/p2p/discv5/net.go index 52c677b623..618340b291 100644 --- a/p2p/discv5/net.go +++ b/p2p/discv5/net.go @@ -36,7 +36,7 @@ import ( var ( errInvalidEvent = errors.New("invalid in current state") errNoQuery = errors.New("no pending query") - errWrongAddress = errors.New("unknown sender address") + //errWrongAddress = errors.New("unknown sender address") ) const ( @@ -828,11 +828,12 @@ type nodeEvent uint //go:generate stringer -type=nodeEvent const ( - invalidEvent nodeEvent = iota // zero is reserved + //invalidEvent + //nodeEvent = iota // zero is reserved // Packet type events. // These correspond to packet types in the UDP protocol. - pingPacket + pingPacket = iota pongPacket findnodePacket neighborsPacket diff --git a/p2p/discv5/table.go b/p2p/discv5/table.go index 2cf05009cb..2c7116610a 100644 --- a/p2p/discv5/table.go +++ b/p2p/discv5/table.go @@ -38,7 +38,7 @@ const ( hashBits = len(common.Hash{}) * 8 nBuckets = hashBits + 1 // Number of buckets - maxBondingPingPongs = 16 + //maxBondingPingPongs = 16 maxFindnodeFailures = 5 ) diff --git a/p2p/discv5/udp.go b/p2p/discv5/udp.go index 6ce72d2c15..0a5b91bb84 100644 --- a/p2p/discv5/udp.go +++ b/p2p/discv5/udp.go @@ -36,25 +36,25 @@ const Version = 4 // Errors var ( - errPacketTooSmall = errors.New("too small") - errBadPrefix = errors.New("bad prefix") - errExpired = errors.New("expired") - errUnsolicitedReply = errors.New("unsolicited reply") - errUnknownNode = errors.New("unknown node") - errTimeout = errors.New("RPC timeout") - errClockWarp = errors.New("reply deadline too far in the future") - errClosed = errors.New("socket closed") + errPacketTooSmall = errors.New("too small") + errBadPrefix = errors.New("bad prefix") + //errExpired = errors.New("expired") + //errUnsolicitedReply = errors.New("unsolicited reply") + //errUnknownNode = errors.New("unknown node") + errTimeout = errors.New("RPC timeout") + //errClockWarp = errors.New("reply deadline too far in the future") + //errClosed = errors.New("socket closed") ) // Timeouts const ( respTimeout = 500 * time.Millisecond - queryDelay = 1000 * time.Millisecond - expiration = 20 * time.Second + //queryDelay = 1000 * time.Millisecond + expiration = 20 * time.Second - ntpFailureThreshold = 32 // Continuous timeouts after which to check NTP - ntpWarningCooldown = 10 * time.Minute // Minimum amount of time to pass before repeating NTP warning - driftThreshold = 10 * time.Second // Allowed clock drift before warning user + //ntpFailureThreshold = 32 // Continuous timeouts after which to check NTP + //ntpWarningCooldown = 10 * time.Minute // Minimum amount of time to pass before repeating NTP warning + driftThreshold = 10 * time.Second // Allowed clock drift before warning user ) // RPC request structures diff --git a/p2p/discv5/udp_test.go b/p2p/discv5/udp_test.go index 7d31815947..4a529cd836 100644 --- a/p2p/discv5/udp_test.go +++ b/p2p/discv5/udp_test.go @@ -24,9 +24,9 @@ import ( "reflect" "sync" "testing" - "time" "github.com/davecgh/go-spew/spew" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/rlp" @@ -38,11 +38,11 @@ func init() { // shared test variables var ( - futureExp = uint64(time.Now().Add(10 * time.Hour).Unix()) - testTarget = NodeID{0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1} - testRemote = rpcEndpoint{IP: net.ParseIP("1.1.1.1").To4(), UDP: 1, TCP: 2} - testLocalAnnounced = rpcEndpoint{IP: net.ParseIP("2.2.2.2").To4(), UDP: 3, TCP: 4} - testLocal = rpcEndpoint{IP: net.ParseIP("3.3.3.3").To4(), UDP: 5, TCP: 6} + //futureExp = uint64(time.Now().Add(10 * time.Hour).Unix()) + //testTarget = NodeID{0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1} + //testRemote = rpcEndpoint{IP: net.ParseIP("1.1.1.1").To4(), UDP: 1, TCP: 2} + //testLocalAnnounced = rpcEndpoint{IP: net.ParseIP("2.2.2.2").To4(), UDP: 3, TCP: 4} + testLocal = rpcEndpoint{IP: net.ParseIP("3.3.3.3").To4(), UDP: 5, TCP: 6} ) // type udpTest struct { diff --git a/p2p/enr/enr.go b/p2p/enr/enr.go index 2c3afb43e9..15aae6c819 100644 --- a/p2p/enr/enr.go +++ b/p2p/enr/enr.go @@ -45,8 +45,8 @@ const SizeLimit = 300 // maximum encoded size of a node record in bytes const ID_SECP256k1_KECCAK = ID("secp256k1-keccak") // the default identity scheme var ( - errNoID = errors.New("unknown or unspecified identity scheme") - errInvalidSigsize = errors.New("invalid signature size") + errNoID = errors.New("unknown or unspecified identity scheme") + //errInvalidSigsize = errors.New("invalid signature size") errInvalidSig = errors.New("invalid signature") errNotSorted = errors.New("record key/value pairs are not sorted by key") errDuplicateKey = errors.New("record contains duplicate key") diff --git a/p2p/enr/enr_test.go b/p2p/enr/enr_test.go index ce7767d105..f4c048a5e0 100644 --- a/p2p/enr/enr_test.go +++ b/p2p/enr/enr_test.go @@ -24,10 +24,11 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/rlp" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/rlp" ) var ( diff --git a/p2p/nat/nat.go b/p2p/nat/nat.go index a254648c66..da88904702 100644 --- a/p2p/nat/nat.go +++ b/p2p/nat/nat.go @@ -25,8 +25,9 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/log" "github.com/jackpal/go-nat-pmp" + + "github.com/ethereum/go-ethereum/log" ) // An implementation of nat.Interface can map local ports to ports diff --git a/p2p/peer.go b/p2p/peer.go index 477d8c2190..cab631d7c6 100644 --- a/p2p/peer.go +++ b/p2p/peer.go @@ -47,8 +47,8 @@ const ( discMsg = 0x01 pingMsg = 0x02 pongMsg = 0x03 - getPeersMsg = 0x04 - peersMsg = 0x05 + //getPeersMsg = 0x04 + //peersMsg = 0x05 ) // protoHandshake is the RLP structure of the protocol handshake. diff --git a/p2p/rlpx.go b/p2p/rlpx.go index a320e81e7c..6870a532c5 100644 --- a/p2p/rlpx.go +++ b/p2p/rlpx.go @@ -35,13 +35,14 @@ import ( "sync" "time" + "github.com/golang/snappy" + "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/ecies" "github.com/ethereum/go-ethereum/crypto/secp256k1" "github.com/ethereum/go-ethereum/crypto/sha3" "github.com/ethereum/go-ethereum/p2p/discover" "github.com/ethereum/go-ethereum/rlp" - "github.com/golang/snappy" ) const ( diff --git a/p2p/rlpx_test.go b/p2p/rlpx_test.go index bca4604021..b6b91d0937 100644 --- a/p2p/rlpx_test.go +++ b/p2p/rlpx_test.go @@ -31,6 +31,7 @@ import ( "time" "github.com/davecgh/go-spew/spew" + "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/ecies" "github.com/ethereum/go-ethereum/crypto/sha3" diff --git a/p2p/simulations/adapters/docker.go b/p2p/simulations/adapters/docker.go index 8ef5629fb5..c92d5a5431 100644 --- a/p2p/simulations/adapters/docker.go +++ b/p2p/simulations/adapters/docker.go @@ -28,6 +28,7 @@ import ( "strings" "github.com/docker/docker/pkg/reexec" + "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/p2p/discover" diff --git a/p2p/simulations/adapters/exec.go b/p2p/simulations/adapters/exec.go index a566fb27d8..9642c1628f 100644 --- a/p2p/simulations/adapters/exec.go +++ b/p2p/simulations/adapters/exec.go @@ -36,12 +36,13 @@ import ( "time" "github.com/docker/docker/pkg/reexec" + "golang.org/x/net/websocket" + "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/p2p/discover" "github.com/ethereum/go-ethereum/rpc" - "golang.org/x/net/websocket" ) // ExecAdapter is a NodeAdapter which runs simulation nodes by executing the diff --git a/p2p/simulations/adapters/types.go b/p2p/simulations/adapters/types.go index 5b4b47fe2f..e5216f2e74 100644 --- a/p2p/simulations/adapters/types.go +++ b/p2p/simulations/adapters/types.go @@ -25,6 +25,7 @@ import ( "os" "github.com/docker/docker/pkg/reexec" + "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/p2p" diff --git a/p2p/simulations/http.go b/p2p/simulations/http.go index 97dd742e88..a28b6e70c8 100644 --- a/p2p/simulations/http.go +++ b/p2p/simulations/http.go @@ -29,13 +29,14 @@ import ( "strings" "sync" + "github.com/julienschmidt/httprouter" + "golang.org/x/net/websocket" + "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/p2p/discover" "github.com/ethereum/go-ethereum/p2p/simulations/adapters" "github.com/ethereum/go-ethereum/rpc" - "github.com/julienschmidt/httprouter" - "golang.org/x/net/websocket" ) // DefaultClient is the default simulation API client which expects the API diff --git a/rpc/client_test.go b/rpc/client_test.go index 4f354d389e..8125ba8596 100644 --- a/rpc/client_test.go +++ b/rpc/client_test.go @@ -31,6 +31,7 @@ import ( "time" "github.com/davecgh/go-spew/spew" + "github.com/ethereum/go-ethereum/log" ) diff --git a/rpc/server.go b/rpc/server.go index 11373b504c..83e2159f8c 100644 --- a/rpc/server.go +++ b/rpc/server.go @@ -25,8 +25,9 @@ import ( "sync" "sync/atomic" - "github.com/ethereum/go-ethereum/log" "gopkg.in/fatih/set.v0" + + "github.com/ethereum/go-ethereum/log" ) const MetadataApi = "rpc" diff --git a/rpc/types.go b/rpc/types.go index f2375604ed..3220a86388 100644 --- a/rpc/types.go +++ b/rpc/types.go @@ -23,8 +23,9 @@ import ( "strings" "sync" - "github.com/ethereum/go-ethereum/common/hexutil" "gopkg.in/fatih/set.v0" + + "github.com/ethereum/go-ethereum/common/hexutil" ) // API describes the set of methods offered over the RPC interface diff --git a/rpc/websocket.go b/rpc/websocket.go index a6e1cec28a..a95cdb145e 100644 --- a/rpc/websocket.go +++ b/rpc/websocket.go @@ -29,9 +29,10 @@ import ( "strings" "time" - "github.com/ethereum/go-ethereum/log" "golang.org/x/net/websocket" "gopkg.in/fatih/set.v0" + + "github.com/ethereum/go-ethereum/log" ) // websocketJSONCodec is a custom JSON codec with payload size enforcement and diff --git a/swarm/api/http/server.go b/swarm/api/http/server.go index b8e7436cf0..1c8f05bdd1 100644 --- a/swarm/api/http/server.go +++ b/swarm/api/http/server.go @@ -35,12 +35,13 @@ import ( "strings" "time" + "github.com/rs/cors" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/swarm/api" "github.com/ethereum/go-ethereum/swarm/storage" - "github.com/rs/cors" ) //setup metrics diff --git a/swarm/fuse/fuse_dir.go b/swarm/fuse/fuse_dir.go index 91b236ae8a..a7701985eb 100644 --- a/swarm/fuse/fuse_dir.go +++ b/swarm/fuse/fuse_dir.go @@ -19,12 +19,13 @@ package fuse import ( - "bazil.org/fuse" - "bazil.org/fuse/fs" - "golang.org/x/net/context" "os" "path/filepath" "sync" + + "bazil.org/fuse" + "bazil.org/fuse/fs" + "golang.org/x/net/context" ) var ( diff --git a/swarm/fuse/fuse_file.go b/swarm/fuse/fuse_file.go index c94a0773f5..f45bf0b377 100644 --- a/swarm/fuse/fuse_file.go +++ b/swarm/fuse/fuse_file.go @@ -26,9 +26,10 @@ import ( "bazil.org/fuse" "bazil.org/fuse/fs" + "golang.org/x/net/context" + "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/swarm/storage" - "golang.org/x/net/context" ) const ( diff --git a/swarm/fuse/swarmfs.go b/swarm/fuse/swarmfs.go index 2493bdab19..e56d0ad4e3 100644 --- a/swarm/fuse/swarmfs.go +++ b/swarm/fuse/swarmfs.go @@ -17,9 +17,10 @@ package fuse import ( - "github.com/ethereum/go-ethereum/swarm/api" "sync" "time" + + "github.com/ethereum/go-ethereum/swarm/api" ) const ( diff --git a/swarm/fuse/swarmfs_unix.go b/swarm/fuse/swarmfs_unix.go index 75742845a2..62a15e780b 100644 --- a/swarm/fuse/swarmfs_unix.go +++ b/swarm/fuse/swarmfs_unix.go @@ -29,6 +29,7 @@ import ( "bazil.org/fuse" "bazil.org/fuse/fs" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/swarm/api" diff --git a/swarm/metrics/flags.go b/swarm/metrics/flags.go index 48b231b219..e74c1a1306 100644 --- a/swarm/metrics/flags.go +++ b/swarm/metrics/flags.go @@ -19,11 +19,12 @@ package metrics import ( "time" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/log" gethmetrics "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/metrics/influxdb" - "gopkg.in/urfave/cli.v1" ) var ( diff --git a/swarm/network/syncdb.go b/swarm/network/syncdb.go index 88b4b68dd0..7c7a4bf686 100644 --- a/swarm/network/syncdb.go +++ b/swarm/network/syncdb.go @@ -20,10 +20,11 @@ import ( "encoding/binary" "fmt" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/swarm/storage" "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/iterator" + + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/swarm/storage" ) const counterKeyPrefix = 0x01 diff --git a/swarm/storage/database.go b/swarm/storage/database.go index 2532490cc9..1bf3bb4c5b 100644 --- a/swarm/storage/database.go +++ b/swarm/storage/database.go @@ -22,10 +22,11 @@ package storage import ( "fmt" - "github.com/ethereum/go-ethereum/compression/rle" "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/iterator" "github.com/syndtr/goleveldb/leveldb/opt" + + "github.com/ethereum/go-ethereum/compression/rle" ) const openFileLimit = 128 diff --git a/swarm/storage/dbstore.go b/swarm/storage/dbstore.go index 421bb061d5..a1ea023a60 100644 --- a/swarm/storage/dbstore.go +++ b/swarm/storage/dbstore.go @@ -32,11 +32,12 @@ import ( "io/ioutil" "sync" + "github.com/syndtr/goleveldb/leveldb" + "github.com/syndtr/goleveldb/leveldb/iterator" + "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/rlp" - "github.com/syndtr/goleveldb/leveldb" - "github.com/syndtr/goleveldb/leveldb/iterator" ) //metrics variables @@ -54,7 +55,7 @@ const ( // key prefixes for leveldb storage kpIndex = 0 - kpData = 1 + //kpData = 1 ) var ( diff --git a/swarm/storage/netstore.go b/swarm/storage/netstore.go index 5d4f17deb1..186670a762 100644 --- a/swarm/storage/netstore.go +++ b/swarm/storage/netstore.go @@ -84,8 +84,8 @@ func NewNetStore(hash SwarmHasher, lstore *LocalStore, cloud CloudStore, params } const ( - // maximum number of peers that a retrieved message is delivered to - requesterCount = 3 +// maximum number of peers that a retrieved message is delivered to +//requesterCount = 3 ) var ( diff --git a/trie/sync.go b/trie/sync.go index b573a9f732..00bc34f40b 100644 --- a/trie/sync.go +++ b/trie/sync.go @@ -20,9 +20,10 @@ import ( "errors" "fmt" + "gopkg.in/karalabe/cookiejar.v2/collections/prque" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethdb" - "gopkg.in/karalabe/cookiejar.v2/collections/prque" ) // ErrNotRequested is returned by the trie sync when it's requested to process a diff --git a/trie/trie_test.go b/trie/trie_test.go index 9972226288..b6a79c2d25 100644 --- a/trie/trie_test.go +++ b/trie/trie_test.go @@ -30,6 +30,7 @@ import ( "testing/quick" "github.com/davecgh/go-spew/spew" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethdb" diff --git a/vendor/github.com/robertkrimen/otto/ast/comments.go b/vendor/github.com/robertkrimen/otto/ast/comments.go index ef2cc3d89b..5c9485525e 100644 --- a/vendor/github.com/robertkrimen/otto/ast/comments.go +++ b/vendor/github.com/robertkrimen/otto/ast/comments.go @@ -2,6 +2,7 @@ package ast import ( "fmt" + "github.com/robertkrimen/otto/file" ) diff --git a/vendor/github.com/robertkrimen/otto/result.go b/vendor/github.com/robertkrimen/otto/result.go index 63642e7d03..a8f9b3b185 100644 --- a/vendor/github.com/robertkrimen/otto/result.go +++ b/vendor/github.com/robertkrimen/otto/result.go @@ -1,7 +1,5 @@ package otto -import () - type _resultKind int const ( diff --git a/vendor/github.com/stretchr/testify/require/require.go b/vendor/github.com/stretchr/testify/require/require.go index 2fe0557846..50f8dc5444 100644 --- a/vendor/github.com/stretchr/testify/require/require.go +++ b/vendor/github.com/stretchr/testify/require/require.go @@ -6,10 +6,11 @@ package require import ( - assert "github.com/stretchr/testify/assert" http "net/http" url "net/url" time "time" + + assert "github.com/stretchr/testify/assert" ) // Condition uses a Comparison to assert a complex condition. diff --git a/vendor/github.com/stretchr/testify/require/require_forward.go b/vendor/github.com/stretchr/testify/require/require_forward.go index c59c3c7b47..cee247f19b 100644 --- a/vendor/github.com/stretchr/testify/require/require_forward.go +++ b/vendor/github.com/stretchr/testify/require/require_forward.go @@ -6,10 +6,11 @@ package require import ( - assert "github.com/stretchr/testify/assert" http "net/http" url "net/url" time "time" + + assert "github.com/stretchr/testify/assert" ) // Condition uses a Comparison to assert a complex condition. diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/storage.go b/vendor/github.com/syndtr/goleveldb/leveldb/storage.go index d45fb5dfeb..6eebc25446 100644 --- a/vendor/github.com/syndtr/goleveldb/leveldb/storage.go +++ b/vendor/github.com/syndtr/goleveldb/leveldb/storage.go @@ -1,8 +1,9 @@ package leveldb import ( - "github.com/syndtr/goleveldb/leveldb/storage" "sync/atomic" + + "github.com/syndtr/goleveldb/leveldb/storage" ) type iStorage struct { diff --git a/vendor/golang.org/x/crypto/openpgp/armor/armor.go b/vendor/golang.org/x/crypto/openpgp/armor/armor.go index 592d186436..ab86e8c072 100644 --- a/vendor/golang.org/x/crypto/openpgp/armor/armor.go +++ b/vendor/golang.org/x/crypto/openpgp/armor/armor.go @@ -10,8 +10,9 @@ import ( "bufio" "bytes" "encoding/base64" - "golang.org/x/crypto/openpgp/errors" "io" + + "golang.org/x/crypto/openpgp/errors" ) // A Block represents an OpenPGP armored structure. diff --git a/vendor/golang.org/x/crypto/openpgp/packet/compressed.go b/vendor/golang.org/x/crypto/openpgp/packet/compressed.go index e8f0b5caa7..6a719dfcea 100644 --- a/vendor/golang.org/x/crypto/openpgp/packet/compressed.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/compressed.go @@ -8,9 +8,10 @@ import ( "compress/bzip2" "compress/flate" "compress/zlib" - "golang.org/x/crypto/openpgp/errors" "io" "strconv" + + "golang.org/x/crypto/openpgp/errors" ) // Compressed represents a compressed OpenPGP packet. The decompressed contents diff --git a/vendor/golang.org/x/crypto/openpgp/packet/one_pass_signature.go b/vendor/golang.org/x/crypto/openpgp/packet/one_pass_signature.go index 1713503395..eb6a31bc6a 100644 --- a/vendor/golang.org/x/crypto/openpgp/packet/one_pass_signature.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/one_pass_signature.go @@ -7,10 +7,11 @@ package packet import ( "crypto" "encoding/binary" - "golang.org/x/crypto/openpgp/errors" - "golang.org/x/crypto/openpgp/s2k" "io" "strconv" + + "golang.org/x/crypto/openpgp/errors" + "golang.org/x/crypto/openpgp/s2k" ) // OnePassSignature represents a one-pass signature packet. See RFC 4880, diff --git a/vendor/golang.org/x/crypto/openpgp/packet/packet.go b/vendor/golang.org/x/crypto/openpgp/packet/packet.go index 3eded93f04..f5183d4e6b 100644 --- a/vendor/golang.org/x/crypto/openpgp/packet/packet.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/packet.go @@ -11,10 +11,11 @@ import ( "crypto/aes" "crypto/cipher" "crypto/des" - "golang.org/x/crypto/cast5" - "golang.org/x/crypto/openpgp/errors" "io" "math/big" + + "golang.org/x/crypto/cast5" + "golang.org/x/crypto/openpgp/errors" ) // readFull is the same as io.ReadFull except that reading zero bytes returns diff --git a/vendor/golang.org/x/crypto/openpgp/packet/reader.go b/vendor/golang.org/x/crypto/openpgp/packet/reader.go index 34bc7c613e..2a4ac85008 100644 --- a/vendor/golang.org/x/crypto/openpgp/packet/reader.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/reader.go @@ -5,8 +5,9 @@ package packet import ( - "golang.org/x/crypto/openpgp/errors" "io" + + "golang.org/x/crypto/openpgp/errors" ) // Reader reads packets from an io.Reader and allows packets to be 'unread' so diff --git a/vendor/golang.org/x/crypto/openpgp/packet/symmetrically_encrypted.go b/vendor/golang.org/x/crypto/openpgp/packet/symmetrically_encrypted.go index 6126030eb9..789a27dca7 100644 --- a/vendor/golang.org/x/crypto/openpgp/packet/symmetrically_encrypted.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/symmetrically_encrypted.go @@ -8,10 +8,11 @@ import ( "crypto/cipher" "crypto/sha1" "crypto/subtle" - "golang.org/x/crypto/openpgp/errors" "hash" "io" "strconv" + + "golang.org/x/crypto/openpgp/errors" ) // SymmetricallyEncrypted represents a symmetrically encrypted byte string. The diff --git a/vendor/golang.org/x/crypto/ssh/terminal/util_solaris.go b/vendor/golang.org/x/crypto/ssh/terminal/util_solaris.go index a2e1b57dc1..5dafc5a8af 100644 --- a/vendor/golang.org/x/crypto/ssh/terminal/util_solaris.go +++ b/vendor/golang.org/x/crypto/ssh/terminal/util_solaris.go @@ -7,9 +7,10 @@ package terminal // import "golang.org/x/crypto/ssh/terminal" import ( - "golang.org/x/sys/unix" "io" "syscall" + + "golang.org/x/sys/unix" ) // State contains the state of a terminal. diff --git a/vendor/gopkg.in/check.v1/benchmark.go b/vendor/gopkg.in/check.v1/benchmark.go index 46ea9dc6da..b2d351948d 100644 --- a/vendor/gopkg.in/check.v1/benchmark.go +++ b/vendor/gopkg.in/check.v1/benchmark.go @@ -1,9 +1,9 @@ // Copyright (c) 2012 The Go Authors. All rights reserved. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: -// +// // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above @@ -13,7 +13,7 @@ // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. -// +// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR diff --git a/whisper/mailserver/mailserver.go b/whisper/mailserver/mailserver.go index 57e6505ad1..2866dcf966 100644 --- a/whisper/mailserver/mailserver.go +++ b/whisper/mailserver/mailserver.go @@ -20,14 +20,15 @@ import ( "encoding/binary" "fmt" + "github.com/syndtr/goleveldb/leveldb" + "github.com/syndtr/goleveldb/leveldb/util" + "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/rlp" whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" - "github.com/syndtr/goleveldb/leveldb" - "github.com/syndtr/goleveldb/leveldb/util" ) type WMailServer struct { diff --git a/whisper/whisperv5/api.go b/whisper/whisperv5/api.go index ee566625c9..bdc313fb0d 100644 --- a/whisper/whisperv5/api.go +++ b/whisper/whisperv5/api.go @@ -33,7 +33,7 @@ import ( ) const ( - filterTimeout = 300 // filters are considered timeout out after filterTimeout seconds +//filterTimeout = 300 // filters are considered timeout out after filterTimeout seconds ) var ( diff --git a/whisper/whisperv5/peer.go b/whisper/whisperv5/peer.go index 179c931795..1e19cabad2 100644 --- a/whisper/whisperv5/peer.go +++ b/whisper/whisperv5/peer.go @@ -20,11 +20,12 @@ import ( "fmt" "time" + set "gopkg.in/fatih/set.v0" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/rlp" - set "gopkg.in/fatih/set.v0" ) // peer represents a whisper protocol peer connection. diff --git a/whisper/whisperv5/whisper.go b/whisper/whisperv5/whisper.go index 85849ccce4..90d56a5761 100644 --- a/whisper/whisperv5/whisper.go +++ b/whisper/whisperv5/whisper.go @@ -26,15 +26,16 @@ import ( "sync" "time" + "github.com/syndtr/goleveldb/leveldb/errors" + "golang.org/x/crypto/pbkdf2" + "golang.org/x/sync/syncmap" + set "gopkg.in/fatih/set.v0" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/rpc" - "github.com/syndtr/goleveldb/leveldb/errors" - "golang.org/x/crypto/pbkdf2" - "golang.org/x/sync/syncmap" - set "gopkg.in/fatih/set.v0" ) type Statistics struct { diff --git a/whisper/whisperv6/api.go b/whisper/whisperv6/api.go index 3f3a082afe..9eaf98fb8d 100644 --- a/whisper/whisperv6/api.go +++ b/whisper/whisperv6/api.go @@ -33,7 +33,7 @@ import ( ) const ( - filterTimeout = 300 // filters are considered timeout out after filterTimeout seconds +//filterTimeout = 300 // filters are considered timeout out after filterTimeout seconds ) // List of errors diff --git a/whisper/whisperv6/api_test.go b/whisper/whisperv6/api_test.go index 004a41c949..295f8dab03 100644 --- a/whisper/whisperv6/api_test.go +++ b/whisper/whisperv6/api_test.go @@ -22,8 +22,9 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" set "gopkg.in/fatih/set.v0" + + "github.com/ethereum/go-ethereum/common" ) func TestMultipleTopicCopyInNewMessageFilter(t *testing.T) { diff --git a/whisper/whisperv6/benchmarks_test.go b/whisper/whisperv6/benchmarks_test.go index 0473179da5..d97ee02c1b 100644 --- a/whisper/whisperv6/benchmarks_test.go +++ b/whisper/whisperv6/benchmarks_test.go @@ -20,8 +20,9 @@ import ( "crypto/sha256" "testing" - "github.com/ethereum/go-ethereum/crypto" "golang.org/x/crypto/pbkdf2" + + "github.com/ethereum/go-ethereum/crypto" ) func BenchmarkDeriveKeyMaterial(b *testing.B) { diff --git a/whisper/whisperv6/peer.go b/whisper/whisperv6/peer.go index 2bf1c905b2..3b39bae443 100644 --- a/whisper/whisperv6/peer.go +++ b/whisper/whisperv6/peer.go @@ -22,11 +22,12 @@ import ( "sync" "time" + set "gopkg.in/fatih/set.v0" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/rlp" - set "gopkg.in/fatih/set.v0" ) // Peer represents a whisper protocol peer connection. diff --git a/whisper/whisperv6/whisper.go b/whisper/whisperv6/whisper.go index 880cced098..455d9c9b10 100644 --- a/whisper/whisperv6/whisper.go +++ b/whisper/whisperv6/whisper.go @@ -26,16 +26,17 @@ import ( "sync" "time" + "github.com/syndtr/goleveldb/leveldb/errors" + "golang.org/x/crypto/pbkdf2" + "golang.org/x/sync/syncmap" + set "gopkg.in/fatih/set.v0" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/rpc" - "github.com/syndtr/goleveldb/leveldb/errors" - "golang.org/x/crypto/pbkdf2" - "golang.org/x/sync/syncmap" - set "gopkg.in/fatih/set.v0" ) // Statistics holds several message-related counter for analytics diff --git a/whisper/whisperv6/whisper_test.go b/whisper/whisperv6/whisper_test.go index 7fe256309e..86d0592b34 100644 --- a/whisper/whisperv6/whisper_test.go +++ b/whisper/whisperv6/whisper_test.go @@ -24,8 +24,9 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" "golang.org/x/crypto/pbkdf2" + + "github.com/ethereum/go-ethereum/common" ) func TestWhisperBasic(t *testing.T) {