diff --git a/.travis.yml b/.travis.yml index a2cec08157..40d940de0d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,6 @@ matrix: - sudo chown root:$USER /etc/fuse.conf - go run build/ci.go install - go run build/ci.go test -coverage - - go run build/ci.go lint # These are the latest Go versions. - os: linux diff --git a/Makefile b/Makefile index 744a3511aa..2c69839fea 100644 --- a/Makefile +++ b/Makefile @@ -40,9 +40,6 @@ test: all lint: ## Run linters. Use make install-linters first. build/env.sh go run build/ci.go lint -format: # Formats the code. Must have goimports installed - build/gofmt.sh - clean: rm -fr build/_workspace/pkg/ $(GOBIN)/* diff --git a/accounts/abi/bind/bind_test.go b/accounts/abi/bind/bind_test.go index 5abad1c69d..2a5a886487 100644 --- a/accounts/abi/bind/bind_test.go +++ b/accounts/abi/bind/bind_test.go @@ -26,9 +26,8 @@ import ( "strings" "testing" - "golang.org/x/tools/imports" - "github.com/ethereum/go-ethereum/common" + "golang.org/x/tools/imports" ) var bindTests = []struct { diff --git a/accounts/abi/event_test.go b/accounts/abi/event_test.go index c4498e9151..cca61e433d 100644 --- a/accounts/abi/event_test.go +++ b/accounts/abi/event_test.go @@ -25,11 +25,10 @@ import ( "strings" "testing" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) var jsonEventTransfer = []byte(`{ diff --git a/accounts/abi/type_test.go b/accounts/abi/type_test.go index fe74369374..f6b36f18fd 100644 --- a/accounts/abi/type_test.go +++ b/accounts/abi/type_test.go @@ -22,7 +22,6 @@ 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 59d394a79f..bdbab10b4f 100644 --- a/accounts/abi/unpack_test.go +++ b/accounts/abi/unpack_test.go @@ -26,9 +26,8 @@ import ( "strings" "testing" - "github.com/stretchr/testify/require" - "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/require" ) type unpackTest struct { diff --git a/accounts/keystore/account_cache.go b/accounts/keystore/account_cache.go index 95c4dec268..71f698ece7 100644 --- a/accounts/keystore/account_cache.go +++ b/accounts/keystore/account_cache.go @@ -27,11 +27,10 @@ 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 884c748915..fe9233c046 100644 --- a/accounts/keystore/account_cache_test.go +++ b/accounts/keystore/account_cache_test.go @@ -29,7 +29,6 @@ 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/key.go b/accounts/keystore/key.go index 65e956f3ea..211fa863d7 100644 --- a/accounts/keystore/key.go +++ b/accounts/keystore/key.go @@ -29,11 +29,10 @@ 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 76b77423a8..eaec39f7df 100644 --- a/accounts/keystore/keystore_passphrase.go +++ b/accounts/keystore/keystore_passphrase.go @@ -36,14 +36,13 @@ 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 3c7550f386..1554294e14 100644 --- a/accounts/keystore/presale.go +++ b/accounts/keystore/presale.go @@ -25,11 +25,10 @@ import ( "errors" "fmt" - "github.com/pborman/uuid" - "golang.org/x/crypto/pbkdf2" - "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/crypto" + "github.com/pborman/uuid" + "golang.org/x/crypto/pbkdf2" ) // 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 82c9b10e4a..bbcfb99257 100644 --- a/accounts/keystore/watch.go +++ b/accounts/keystore/watch.go @@ -21,9 +21,8 @@ package keystore import ( "time" - "github.com/rjeczalik/notify" - "github.com/ethereum/go-ethereum/log" + "github.com/rjeczalik/notify" ) type watcher struct { diff --git a/accounts/usbwallet/hub.go b/accounts/usbwallet/hub.go index 1989a9e366..61fc98ccc8 100644 --- a/accounts/usbwallet/hub.go +++ b/accounts/usbwallet/hub.go @@ -22,11 +22,10 @@ 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 9da72462a9..57f4a7ffc5 100644 --- a/accounts/usbwallet/ledger.go +++ b/accounts/usbwallet/ledger.go @@ -53,11 +53,9 @@ const ( 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 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 ) // errLedgerReplyInvalidHeader is the error message returned by a Ledger data exchange diff --git a/accounts/usbwallet/trezor.go b/accounts/usbwallet/trezor.go index 35f7e6aa88..b84a955992 100644 --- a/accounts/usbwallet/trezor.go +++ b/accounts/usbwallet/trezor.go @@ -27,14 +27,13 @@ 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 30712dc5d2..8b3b5a5224 100644 --- a/accounts/usbwallet/wallet.go +++ b/accounts/usbwallet/wallet.go @@ -25,13 +25,12 @@ 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/build/gofmt.sh b/build/goimports.sh similarity index 100% rename from build/gofmt.sh rename to build/goimports.sh diff --git a/cmd/ethkey/generate.go b/cmd/ethkey/generate.go index b4d22613bd..6d57d17fb4 100644 --- a/cmd/ethkey/generate.go +++ b/cmd/ethkey/generate.go @@ -23,12 +23,11 @@ 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/main.go b/cmd/ethkey/main.go index 7543c1efdb..4127f5566f 100644 --- a/cmd/ethkey/main.go +++ b/cmd/ethkey/main.go @@ -53,10 +53,6 @@ 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", - //} ) func main() { diff --git a/cmd/ethkey/run_test.go b/cmd/ethkey/run_test.go index 857d3045ab..6006f6b5bb 100644 --- a/cmd/ethkey/run_test.go +++ b/cmd/ethkey/run_test.go @@ -22,7 +22,6 @@ import ( "testing" "github.com/docker/docker/pkg/reexec" - "github.com/ethereum/go-ethereum/internal/cmdtest" ) diff --git a/cmd/evm/disasm.go b/cmd/evm/disasm.go index 19bc28e15a..4a442cf784 100644 --- a/cmd/evm/disasm.go +++ b/cmd/evm/disasm.go @@ -22,9 +22,8 @@ import ( "io/ioutil" "strings" - cli "gopkg.in/urfave/cli.v1" - "github.com/ethereum/go-ethereum/core/asm" + cli "gopkg.in/urfave/cli.v1" ) var disasmCommand = cli.Command{ diff --git a/cmd/evm/runner.go b/cmd/evm/runner.go index 0e44e84aa5..8a7399840c 100644 --- a/cmd/evm/runner.go +++ b/cmd/evm/runner.go @@ -27,8 +27,6 @@ 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" @@ -39,6 +37,7 @@ 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 9668813c03..5bad09bbd5 100644 --- a/cmd/faucet/faucet.go +++ b/cmd/faucet/faucet.go @@ -41,8 +41,6 @@ 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" @@ -60,6 +58,7 @@ 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/bugcmd.go b/cmd/geth/bugcmd.go index ecfb7ffa22..ce9dbe6c0a 100644 --- a/cmd/geth/bugcmd.go +++ b/cmd/geth/bugcmd.go @@ -29,9 +29,8 @@ import ( "github.com/ethereum/go-ethereum/cmd/internal/browser" "github.com/ethereum/go-ethereum/params" - cli "gopkg.in/urfave/cli.v1" - "github.com/ethereum/go-ethereum/cmd/utils" + cli "gopkg.in/urfave/cli.v1" ) var bugCommand = cli.Command{ diff --git a/cmd/geth/config.go b/cmd/geth/config.go index 1cd9c6be98..e6bd4d5bef 100644 --- a/cmd/geth/config.go +++ b/cmd/geth/config.go @@ -27,14 +27,13 @@ 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/run_test.go b/cmd/geth/run_test.go index f94050124a..da82facac3 100644 --- a/cmd/geth/run_test.go +++ b/cmd/geth/run_test.go @@ -23,7 +23,6 @@ import ( "testing" "github.com/docker/docker/pkg/reexec" - "github.com/ethereum/go-ethereum/internal/cmdtest" ) diff --git a/cmd/p2psim/main.go b/cmd/p2psim/main.go index 38a54add4e..0c8ed038d5 100644 --- a/cmd/p2psim/main.go +++ b/cmd/p2psim/main.go @@ -45,14 +45,13 @@ 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/ssh.go b/cmd/puppeth/ssh.go index ffc1488336..158261ce05 100644 --- a/cmd/puppeth/ssh.go +++ b/cmd/puppeth/ssh.go @@ -28,10 +28,9 @@ 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 09f67809fe..b88a61de7d 100644 --- a/cmd/puppeth/wizard.go +++ b/cmd/puppeth/wizard.go @@ -30,11 +30,10 @@ 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 3c02925054..90bf7ae3c8 100644 --- a/cmd/puppeth/wizard_netstats.go +++ b/cmd/puppeth/wizard_netstats.go @@ -23,10 +23,9 @@ 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 bfd1a3d961..adac772bab 100644 --- a/cmd/swarm/config.go +++ b/cmd/swarm/config.go @@ -28,12 +28,11 @@ 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/run_test.go b/cmd/swarm/run_test.go index 76310e2fa0..594cfa55cb 100644 --- a/cmd/swarm/run_test.go +++ b/cmd/swarm/run_test.go @@ -27,7 +27,6 @@ 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/wnode/main.go b/cmd/wnode/main.go index 6aeeb1bbe3..988c50ce3d 100644 --- a/cmd/wnode/main.go +++ b/cmd/wnode/main.go @@ -35,8 +35,6 @@ 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" @@ -47,6 +45,7 @@ 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 22476d94fb..2bdad9092a 100644 --- a/consensus/clique/clique.go +++ b/consensus/clique/clique.go @@ -25,8 +25,6 @@ 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" @@ -41,6 +39,7 @@ 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 d71ced007f..9ebdb8df15 100644 --- a/consensus/clique/snapshot.go +++ b/consensus/clique/snapshot.go @@ -20,12 +20,11 @@ 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 5774af1a78..be5e661c12 100644 --- a/consensus/consensus.go +++ b/consensus/consensus.go @@ -18,13 +18,12 @@ 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 477019c51d..99eec82211 100644 --- a/consensus/ethash/consensus.go +++ b/consensus/ethash/consensus.go @@ -24,8 +24,6 @@ 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" @@ -33,6 +31,7 @@ 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 ba56fb92ea..1b3dcee302 100644 --- a/consensus/ethash/ethash.go +++ b/consensus/ethash/ethash.go @@ -33,12 +33,11 @@ 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 dd12f797e0..b28cc438e2 100644 --- a/console/bridge.go +++ b/console/bridge.go @@ -23,11 +23,10 @@ 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 cef5d3c7be..b280d4e65d 100644 --- a/console/console.go +++ b/console/console.go @@ -28,13 +28,12 @@ import ( "strings" "syscall" - "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" + "github.com/mattn/go-colorable" + "github.com/peterh/liner" + "github.com/robertkrimen/otto" ) var ( diff --git a/core/asm/compiler.go b/core/asm/compiler.go index abe2992a92..b430b6495c 100644 --- a/core/asm/compiler.go +++ b/core/asm/compiler.go @@ -263,10 +263,6 @@ 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") -//) func compileErr(c token, got, want string) error { return compileError{ diff --git a/core/genesis_test.go b/core/genesis_test.go index 48845c1286..052ded6991 100644 --- a/core/genesis_test.go +++ b/core/genesis_test.go @@ -22,7 +22,6 @@ 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 70dfe6dd20..2d1b0a2a18 100644 --- a/core/headerchain.go +++ b/core/headerchain.go @@ -26,14 +26,13 @@ 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 8bf8b9b411..c1b630991c 100644 --- a/core/state/database.go +++ b/core/state/database.go @@ -20,11 +20,10 @@ 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 5e527fc115..6d42d63d82 100644 --- a/core/state/state_test.go +++ b/core/state/state_test.go @@ -21,11 +21,10 @@ 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 8db43e811c..6886326cc0 100644 --- a/core/tx_pool.go +++ b/core/tx_pool.go @@ -25,8 +25,6 @@ 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" @@ -34,13 +32,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 ) var ( diff --git a/core/types/log_test.go b/core/types/log_test.go index bbe872b664..0e56acfe4a 100644 --- a/core/types/log_test.go +++ b/core/types/log_test.go @@ -23,7 +23,6 @@ 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 adf08c40c4..92fd8f898e 100644 --- a/core/types/transaction.go +++ b/core/types/transaction.go @@ -33,7 +33,6 @@ import ( var ( ErrInvalidSig = errors.New("invalid transaction v, r, s values") - //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 237ac18d7d..237450ea96 100644 --- a/core/vm/contracts.go +++ b/core/vm/contracts.go @@ -21,13 +21,12 @@ 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 bcb8c40bfa..bb313f2a35 100644 --- a/core/vm/instructions.go +++ b/core/vm/instructions.go @@ -31,7 +31,6 @@ import ( var ( 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/dashboard/dashboard.go b/dashboard/dashboard.go index bc222123a8..399fa34c08 100644 --- a/dashboard/dashboard.go +++ b/dashboard/dashboard.go @@ -33,13 +33,12 @@ 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 99d8e3bbff..900a82bb6a 100644 --- a/eth/api_test.go +++ b/eth/api_test.go @@ -21,7 +21,6 @@ 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 cd065caf1e..bbe0aed5dc 100644 --- a/eth/downloader/queue.go +++ b/eth/downloader/queue.go @@ -25,12 +25,11 @@ 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 7e2077b462..0c679cec3a 100644 --- a/eth/fetcher/fetcher.go +++ b/eth/fetcher/fetcher.go @@ -22,12 +22,11 @@ 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/tracers/tracer.go b/eth/tracers/tracer.go index 4305148837..4cec9e633c 100644 --- a/eth/tracers/tracer.go +++ b/eth/tracers/tracer.go @@ -25,13 +25,12 @@ 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 f4ac51622a..30ed37dc7b 100644 --- a/ethdb/database.go +++ b/ethdb/database.go @@ -22,15 +22,14 @@ 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 d290fd615d..ae7e252654 100644 --- a/ethstats/ethstats.go +++ b/ethstats/ethstats.go @@ -30,8 +30,6 @@ 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" @@ -43,6 +41,7 @@ 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 d928ea71b8..1f181bf8b0 100644 --- a/internal/debug/flags.go +++ b/internal/debug/flags.go @@ -24,12 +24,11 @@ import ( "os" "runtime" - colorable "github.com/mattn/go-colorable" - "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" ) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 876b2c5697..e2bfbaf307 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -26,9 +26,6 @@ import ( "time" "github.com/davecgh/go-spew/spew" - "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" @@ -44,6 +41,8 @@ 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 b8079b2137..f05865eca6 100644 --- a/internal/jsre/jsre.go +++ b/internal/jsre/jsre.go @@ -26,10 +26,9 @@ 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 900b7a7af0..1b16f6de43 100644 --- a/les/bloombits.go +++ b/les/bloombits.go @@ -73,12 +73,3 @@ 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 - -// 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 a87d8d18af..da73b4b3c5 100644 --- a/les/serverpool.go +++ b/les/serverpool.go @@ -73,7 +73,6 @@ 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 pstatReturnToMeanTC = time.Hour // node address selection weight is dropped by a factor of exp(-addrFailDropLn) after // each unsuccessful connection (restored after a successful one) @@ -83,9 +82,6 @@ const ( responseScoreTC = time.Millisecond * 100 delayScoreTC = time.Second * 5 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 // 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 22825b1e05..d32a3efb9c 100644 --- a/les/sync.go +++ b/les/sync.go @@ -25,10 +25,6 @@ import ( "github.com/ethereum/go-ethereum/light" ) -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 -) // syncer is responsible for periodically synchronising with the network, both // downloading hashes and blocks as well as handling the announcement handler. diff --git a/light/trie_test.go b/light/trie_test.go index 876caa9ed7..0d6b2cc1d8 100644 --- a/light/trie_test.go +++ b/light/trie_test.go @@ -23,7 +23,6 @@ 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 94f5ec4e4f..d5cb4da66f 100644 --- a/metrics/influxdb/influxdb.go +++ b/metrics/influxdb/influxdb.go @@ -6,9 +6,8 @@ import ( uurl "net/url" "time" - "github.com/influxdata/influxdb/client" - "github.com/ethereum/go-ethereum/metrics" + "github.com/influxdata/influxdb/client" ) type reporter struct { diff --git a/node/node.go b/node/node.go index eebbd92401..b02aecfad1 100644 --- a/node/node.go +++ b/node/node.go @@ -26,8 +26,6 @@ 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" @@ -35,6 +33,7 @@ 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 603021e823..2a7941fc65 100644 --- a/p2p/dial_test.go +++ b/p2p/dial_test.go @@ -24,7 +24,6 @@ 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 0b856d68c6..6f98de9b42 100644 --- a/p2p/discover/database.go +++ b/p2p/discover/database.go @@ -27,16 +27,15 @@ 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 f585452f47..025f81282e 100644 --- a/p2p/discover/udp.go +++ b/p2p/discover/udp.go @@ -49,7 +49,6 @@ var ( // Timeouts const ( respTimeout = 500 * time.Millisecond - //sendTimeout = 500 * time.Millisecond expiration = 20 * time.Second ntpFailureThreshold = 32 // Continuous timeouts after which to check NTP diff --git a/p2p/discover/udp_test.go b/p2p/discover/udp_test.go index 817b6e26f4..db9804f7bc 100644 --- a/p2p/discover/udp_test.go +++ b/p2p/discover/udp_test.go @@ -34,7 +34,6 @@ 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 514ae49ef0..3c2d5744c3 100644 --- a/p2p/discv5/database.go +++ b/p2p/discv5/database.go @@ -28,16 +28,15 @@ 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 618340b291..f56e0d3201 100644 --- a/p2p/discv5/net.go +++ b/p2p/discv5/net.go @@ -36,7 +36,6 @@ import ( var ( errInvalidEvent = errors.New("invalid in current state") errNoQuery = errors.New("no pending query") - //errWrongAddress = errors.New("unknown sender address") ) const ( @@ -828,8 +827,6 @@ type nodeEvent uint //go:generate stringer -type=nodeEvent const ( - //invalidEvent - //nodeEvent = iota // zero is reserved // Packet type events. // These correspond to packet types in the UDP protocol. diff --git a/p2p/discv5/table.go b/p2p/discv5/table.go index 2c7116610a..c8d234b936 100644 --- a/p2p/discv5/table.go +++ b/p2p/discv5/table.go @@ -38,7 +38,6 @@ const ( hashBits = len(common.Hash{}) * 8 nBuckets = hashBits + 1 // Number of buckets - //maxBondingPingPongs = 16 maxFindnodeFailures = 5 ) diff --git a/p2p/discv5/udp.go b/p2p/discv5/udp.go index 0a5b91bb84..5b86698f29 100644 --- a/p2p/discv5/udp.go +++ b/p2p/discv5/udp.go @@ -38,22 +38,14 @@ const Version = 4 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") ) // Timeouts const ( respTimeout = 500 * time.Millisecond - //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 ) diff --git a/p2p/discv5/udp_test.go b/p2p/discv5/udp_test.go index 4a529cd836..62184aa9d3 100644 --- a/p2p/discv5/udp_test.go +++ b/p2p/discv5/udp_test.go @@ -26,7 +26,6 @@ import ( "testing" "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,10 +37,6 @@ 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} ) diff --git a/p2p/enr/enr.go b/p2p/enr/enr.go index 15aae6c819..9244076c96 100644 --- a/p2p/enr/enr.go +++ b/p2p/enr/enr.go @@ -46,7 +46,6 @@ const ID_SECP256k1_KECCAK = ID("secp256k1-keccak") // the default identity schem var ( 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 f4c048a5e0..ce7767d105 100644 --- a/p2p/enr/enr_test.go +++ b/p2p/enr/enr_test.go @@ -24,11 +24,10 @@ import ( "testing" "time" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/rlp" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) var ( diff --git a/p2p/peer.go b/p2p/peer.go index cab631d7c6..73e33418ed 100644 --- a/p2p/peer.go +++ b/p2p/peer.go @@ -47,8 +47,6 @@ const ( discMsg = 0x01 pingMsg = 0x02 pongMsg = 0x03 - //getPeersMsg = 0x04 - //peersMsg = 0x05 ) // protoHandshake is the RLP structure of the protocol handshake. diff --git a/p2p/rlpx.go b/p2p/rlpx.go index 6870a532c5..a320e81e7c 100644 --- a/p2p/rlpx.go +++ b/p2p/rlpx.go @@ -35,14 +35,13 @@ 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 b6b91d0937..bca4604021 100644 --- a/p2p/rlpx_test.go +++ b/p2p/rlpx_test.go @@ -31,7 +31,6 @@ 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 c92d5a5431..8ef5629fb5 100644 --- a/p2p/simulations/adapters/docker.go +++ b/p2p/simulations/adapters/docker.go @@ -28,7 +28,6 @@ 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 9642c1628f..a566fb27d8 100644 --- a/p2p/simulations/adapters/exec.go +++ b/p2p/simulations/adapters/exec.go @@ -36,13 +36,12 @@ 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 e5216f2e74..5b4b47fe2f 100644 --- a/p2p/simulations/adapters/types.go +++ b/p2p/simulations/adapters/types.go @@ -25,7 +25,6 @@ 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 a28b6e70c8..97dd742e88 100644 --- a/p2p/simulations/http.go +++ b/p2p/simulations/http.go @@ -29,14 +29,13 @@ 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 8125ba8596..4f354d389e 100644 --- a/rpc/client_test.go +++ b/rpc/client_test.go @@ -31,7 +31,6 @@ import ( "time" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/log" ) diff --git a/rpc/websocket.go b/rpc/websocket.go index 59a0420c03..a6e1cec28a 100644 --- a/rpc/websocket.go +++ b/rpc/websocket.go @@ -29,9 +29,8 @@ import ( "strings" "time" - "golang.org/x/net/websocket" - "github.com/ethereum/go-ethereum/log" + "golang.org/x/net/websocket" "gopkg.in/fatih/set.v0" ) diff --git a/swarm/api/http/server.go b/swarm/api/http/server.go index 1c8f05bdd1..b8e7436cf0 100644 --- a/swarm/api/http/server.go +++ b/swarm/api/http/server.go @@ -35,13 +35,12 @@ 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 a7701985eb..91b236ae8a 100644 --- a/swarm/fuse/fuse_dir.go +++ b/swarm/fuse/fuse_dir.go @@ -19,13 +19,12 @@ package fuse import ( - "os" - "path/filepath" - "sync" - "bazil.org/fuse" "bazil.org/fuse/fs" "golang.org/x/net/context" + "os" + "path/filepath" + "sync" ) var ( diff --git a/swarm/fuse/fuse_file.go b/swarm/fuse/fuse_file.go index f45bf0b377..c94a0773f5 100644 --- a/swarm/fuse/fuse_file.go +++ b/swarm/fuse/fuse_file.go @@ -26,10 +26,9 @@ 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 e56d0ad4e3..2493bdab19 100644 --- a/swarm/fuse/swarmfs.go +++ b/swarm/fuse/swarmfs.go @@ -17,10 +17,9 @@ 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 62a15e780b..75742845a2 100644 --- a/swarm/fuse/swarmfs_unix.go +++ b/swarm/fuse/swarmfs_unix.go @@ -29,7 +29,6 @@ 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/network/syncdb.go b/swarm/network/syncdb.go index 7c7a4bf686..88b4b68dd0 100644 --- a/swarm/network/syncdb.go +++ b/swarm/network/syncdb.go @@ -20,11 +20,10 @@ import ( "encoding/binary" "fmt" - "github.com/syndtr/goleveldb/leveldb" - "github.com/syndtr/goleveldb/leveldb/iterator" - "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/swarm/storage" + "github.com/syndtr/goleveldb/leveldb" + "github.com/syndtr/goleveldb/leveldb/iterator" ) const counterKeyPrefix = 0x01 diff --git a/swarm/storage/database.go b/swarm/storage/database.go index 1bf3bb4c5b..2532490cc9 100644 --- a/swarm/storage/database.go +++ b/swarm/storage/database.go @@ -22,11 +22,10 @@ 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 a1ea023a60..1ff42a0c05 100644 --- a/swarm/storage/dbstore.go +++ b/swarm/storage/dbstore.go @@ -32,12 +32,11 @@ 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 @@ -55,7 +54,6 @@ const ( // key prefixes for leveldb storage kpIndex = 0 - //kpData = 1 ) var ( diff --git a/swarm/storage/netstore.go b/swarm/storage/netstore.go index 186670a762..2efc02b596 100644 --- a/swarm/storage/netstore.go +++ b/swarm/storage/netstore.go @@ -83,10 +83,6 @@ func NewNetStore(hash SwarmHasher, lstore *LocalStore, cloud CloudStore, params } } -const ( -// maximum number of peers that a retrieved message is delivered to -//requesterCount = 3 -) var ( // timeout interval before retrieval is timed out diff --git a/trie/sync.go b/trie/sync.go index 00bc34f40b..b573a9f732 100644 --- a/trie/sync.go +++ b/trie/sync.go @@ -20,10 +20,9 @@ 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 b6a79c2d25..9972226288 100644 --- a/trie/trie_test.go +++ b/trie/trie_test.go @@ -30,7 +30,6 @@ 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/whisper/mailserver/mailserver.go b/whisper/mailserver/mailserver.go index 2866dcf966..57e6505ad1 100644 --- a/whisper/mailserver/mailserver.go +++ b/whisper/mailserver/mailserver.go @@ -20,15 +20,14 @@ 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 bdc313fb0d..48bb817cb9 100644 --- a/whisper/whisperv5/api.go +++ b/whisper/whisperv5/api.go @@ -32,9 +32,6 @@ import ( "github.com/ethereum/go-ethereum/rpc" ) -const ( -//filterTimeout = 300 // filters are considered timeout out after filterTimeout seconds -) var ( ErrSymAsym = errors.New("specify either a symmetric or an asymmetric key") diff --git a/whisper/whisperv5/peer.go b/whisper/whisperv5/peer.go index 1e19cabad2..179c931795 100644 --- a/whisper/whisperv5/peer.go +++ b/whisper/whisperv5/peer.go @@ -20,12 +20,11 @@ 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 90d56a5761..85849ccce4 100644 --- a/whisper/whisperv5/whisper.go +++ b/whisper/whisperv5/whisper.go @@ -26,16 +26,15 @@ 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 9eaf98fb8d..d879b6d695 100644 --- a/whisper/whisperv6/api.go +++ b/whisper/whisperv6/api.go @@ -32,9 +32,6 @@ import ( "github.com/ethereum/go-ethereum/rpc" ) -const ( -//filterTimeout = 300 // filters are considered timeout out after filterTimeout seconds -) // List of errors var ( diff --git a/whisper/whisperv6/api_test.go b/whisper/whisperv6/api_test.go index 295f8dab03..004a41c949 100644 --- a/whisper/whisperv6/api_test.go +++ b/whisper/whisperv6/api_test.go @@ -22,9 +22,8 @@ import ( "testing" "time" - set "gopkg.in/fatih/set.v0" - "github.com/ethereum/go-ethereum/common" + set "gopkg.in/fatih/set.v0" ) func TestMultipleTopicCopyInNewMessageFilter(t *testing.T) { diff --git a/whisper/whisperv6/benchmarks_test.go b/whisper/whisperv6/benchmarks_test.go index d97ee02c1b..0473179da5 100644 --- a/whisper/whisperv6/benchmarks_test.go +++ b/whisper/whisperv6/benchmarks_test.go @@ -20,9 +20,8 @@ import ( "crypto/sha256" "testing" - "golang.org/x/crypto/pbkdf2" - "github.com/ethereum/go-ethereum/crypto" + "golang.org/x/crypto/pbkdf2" ) func BenchmarkDeriveKeyMaterial(b *testing.B) { diff --git a/whisper/whisperv6/peer.go b/whisper/whisperv6/peer.go index 3b39bae443..2bf1c905b2 100644 --- a/whisper/whisperv6/peer.go +++ b/whisper/whisperv6/peer.go @@ -22,12 +22,11 @@ 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 455d9c9b10..880cced098 100644 --- a/whisper/whisperv6/whisper.go +++ b/whisper/whisperv6/whisper.go @@ -26,17 +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/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 86d0592b34..7fe256309e 100644 --- a/whisper/whisperv6/whisper_test.go +++ b/whisper/whisperv6/whisper_test.go @@ -24,9 +24,8 @@ import ( "testing" "time" - "golang.org/x/crypto/pbkdf2" - "github.com/ethereum/go-ethereum/common" + "golang.org/x/crypto/pbkdf2" ) func TestWhisperBasic(t *testing.T) {