From 18d1cb80d02f25a89922db781cf00a7aa06d9a7b Mon Sep 17 00:00:00 2001 From: danidomi Date: Thu, 15 Aug 2024 07:49:28 +0100 Subject: [PATCH] feat: sort imports --- accounts/abi/bind/base_test.go | 3 ++- accounts/accounts.go | 3 ++- accounts/keystore/account_cache.go | 1 + accounts/keystore/account_cache_test.go | 1 + beacon/blsync/block_sync_test.go | 5 +++-- beacon/types/beacon_block.go | 5 +++-- beacon/types/config.go | 3 ++- cmd/evm/blockrunner.go | 3 ++- cmd/evm/internal/t8ntool/block.go | 3 ++- cmd/geth/accountcmd.go | 3 ++- cmd/geth/config.go | 5 +++-- core/asm/asm_test.go | 3 +-- core/blockchain_test.go | 3 ++- core/rawdb/accessors_chain_test.go | 3 ++- core/state/access_events.go | 3 ++- core/txpool/blobpool/blobpool.go | 5 +++-- core/txpool/blobpool/blobpool_test.go | 5 +++-- eth/api_debug_test.go | 3 ++- eth/catalyst/api_test.go | 3 ++- internal/era/accumulator.go | 3 ++- internal/ethapi/api.go | 5 +++-- node/api_test.go | 3 ++- params/config_test.go | 3 ++- signer/storage/aes_gcm_storage_test.go | 3 ++- 24 files changed, 51 insertions(+), 29 deletions(-) diff --git a/accounts/abi/bind/base_test.go b/accounts/abi/bind/base_test.go index f7eb7d14d3..58a21cb801 100644 --- a/accounts/abi/bind/base_test.go +++ b/accounts/abi/bind/base_test.go @@ -24,6 +24,8 @@ import ( "strings" "testing" + "github.com/stretchr/testify/assert" + "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" @@ -32,7 +34,6 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/rlp" - "github.com/stretchr/testify/assert" ) func mockSign(addr common.Address, tx *types.Transaction) (*types.Transaction, error) { return tx, nil } diff --git a/accounts/accounts.go b/accounts/accounts.go index b995498a6d..7150ffe2f1 100644 --- a/accounts/accounts.go +++ b/accounts/accounts.go @@ -21,11 +21,12 @@ import ( "fmt" "math/big" + "golang.org/x/crypto/sha3" + "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" - "golang.org/x/crypto/sha3" ) // Account represents an Ethereum account located at a specific location defined diff --git a/accounts/keystore/account_cache.go b/accounts/keystore/account_cache.go index f7cf688e62..810ab6c16d 100644 --- a/accounts/keystore/account_cache.go +++ b/accounts/keystore/account_cache.go @@ -29,6 +29,7 @@ import ( "time" mapset "github.com/deckarep/golang-set/v2" + "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" diff --git a/accounts/keystore/account_cache_test.go b/accounts/keystore/account_cache_test.go index c9a8cdfcef..fb73da26e8 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/beacon/blsync/block_sync_test.go b/beacon/blsync/block_sync_test.go index 3d3b9e5e8d..b22520580e 100644 --- a/beacon/blsync/block_sync_test.go +++ b/beacon/blsync/block_sync_test.go @@ -19,12 +19,13 @@ package blsync import ( "testing" + zrntcommon "github.com/protolambda/zrnt/eth2/beacon/common" + "github.com/protolambda/zrnt/eth2/beacon/deneb" + "github.com/ethereum/go-ethereum/beacon/light/request" "github.com/ethereum/go-ethereum/beacon/light/sync" "github.com/ethereum/go-ethereum/beacon/types" "github.com/ethereum/go-ethereum/common" - zrntcommon "github.com/protolambda/zrnt/eth2/beacon/common" - "github.com/protolambda/zrnt/eth2/beacon/deneb" ) var ( diff --git a/beacon/types/beacon_block.go b/beacon/types/beacon_block.go index e4cd1340e5..7ab96780bd 100644 --- a/beacon/types/beacon_block.go +++ b/beacon/types/beacon_block.go @@ -20,13 +20,14 @@ import ( "encoding/json" "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" "github.com/protolambda/zrnt/eth2/beacon/capella" zrntcommon "github.com/protolambda/zrnt/eth2/beacon/common" "github.com/protolambda/zrnt/eth2/beacon/deneb" "github.com/protolambda/zrnt/eth2/configs" "github.com/protolambda/ztyp/tree" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" ) type blockObject interface { diff --git a/beacon/types/config.go b/beacon/types/config.go index 7706e85f6c..6d3d0f4d02 100644 --- a/beacon/types/config.go +++ b/beacon/types/config.go @@ -26,11 +26,12 @@ import ( "strconv" "strings" + "gopkg.in/yaml.v3" + "github.com/ethereum/go-ethereum/beacon/merkle" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/log" - "gopkg.in/yaml.v3" ) // syncCommitteeDomain specifies the signatures specific use to avoid clashes diff --git a/cmd/evm/blockrunner.go b/cmd/evm/blockrunner.go index d5cd8d8e3d..9cc4886634 100644 --- a/cmd/evm/blockrunner.go +++ b/cmd/evm/blockrunner.go @@ -24,12 +24,13 @@ import ( "regexp" "sort" + "github.com/urfave/cli/v2" + "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/rawdb" "github.com/ethereum/go-ethereum/core/tracing" "github.com/ethereum/go-ethereum/eth/tracers/logger" "github.com/ethereum/go-ethereum/tests" - "github.com/urfave/cli/v2" ) var RunFlag = &cli.StringFlag{ diff --git a/cmd/evm/internal/t8ntool/block.go b/cmd/evm/internal/t8ntool/block.go index 37a6db9ffc..a3b77a1976 100644 --- a/cmd/evm/internal/t8ntool/block.go +++ b/cmd/evm/internal/t8ntool/block.go @@ -24,6 +24,8 @@ import ( "math/big" "os" + "github.com/urfave/cli/v2" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/common/math" @@ -31,7 +33,6 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/rlp" - "github.com/urfave/cli/v2" ) //go:generate go run github.com/fjl/gencodec -type header -field-override headerMarshaling -out gen_header.go diff --git a/cmd/geth/accountcmd.go b/cmd/geth/accountcmd.go index cc22684e0b..18b3c46db5 100644 --- a/cmd/geth/accountcmd.go +++ b/cmd/geth/accountcmd.go @@ -20,12 +20,13 @@ import ( "fmt" "os" + "github.com/urfave/cli/v2" + "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/crypto" "github.com/ethereum/go-ethereum/log" - "github.com/urfave/cli/v2" ) var ( diff --git a/cmd/geth/config.go b/cmd/geth/config.go index 522e5e22f2..983f206bdb 100644 --- a/cmd/geth/config.go +++ b/cmd/geth/config.go @@ -26,6 +26,9 @@ import ( "strings" "unicode" + "github.com/naoina/toml" + "github.com/urfave/cli/v2" + "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts/external" "github.com/ethereum/go-ethereum/accounts/keystore" @@ -44,8 +47,6 @@ import ( "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rpc" - "github.com/naoina/toml" - "github.com/urfave/cli/v2" ) var ( diff --git a/core/asm/asm_test.go b/core/asm/asm_test.go index cd7520ec63..e25e2942e4 100644 --- a/core/asm/asm_test.go +++ b/core/asm/asm_test.go @@ -17,9 +17,8 @@ package asm import ( - "testing" - "encoding/hex" + "testing" ) // Tests disassembling instructions diff --git a/core/blockchain_test.go b/core/blockchain_test.go index 4f28c6f5e6..1e50e69fc5 100644 --- a/core/blockchain_test.go +++ b/core/blockchain_test.go @@ -26,6 +26,8 @@ import ( "testing" "time" + "github.com/holiman/uint256" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/math" "github.com/ethereum/go-ethereum/consensus" @@ -40,7 +42,6 @@ import ( "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/trie" - "github.com/holiman/uint256" ) // So we can deterministically seed different blockchains diff --git a/core/rawdb/accessors_chain_test.go b/core/rawdb/accessors_chain_test.go index 2d30af4b3d..d2a292e63d 100644 --- a/core/rawdb/accessors_chain_test.go +++ b/core/rawdb/accessors_chain_test.go @@ -26,12 +26,13 @@ import ( "reflect" "testing" + "golang.org/x/crypto/sha3" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rlp" - "golang.org/x/crypto/sha3" ) // Tests block header storage and retrieval operations. diff --git a/core/state/access_events.go b/core/state/access_events.go index 4b6c7c7e69..4c349f6ea0 100644 --- a/core/state/access_events.go +++ b/core/state/access_events.go @@ -19,11 +19,12 @@ package state import ( "maps" + "github.com/holiman/uint256" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/math" "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/trie/utils" - "github.com/holiman/uint256" ) // mode specifies how a tree location has been accessed diff --git a/core/txpool/blobpool/blobpool.go b/core/txpool/blobpool/blobpool.go index d66a08aa17..4343945385 100644 --- a/core/txpool/blobpool/blobpool.go +++ b/core/txpool/blobpool/blobpool.go @@ -29,6 +29,9 @@ import ( "sync" "time" + "github.com/holiman/billy" + "github.com/holiman/uint256" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus/misc/eip1559" "github.com/ethereum/go-ethereum/consensus/misc/eip4844" @@ -41,8 +44,6 @@ import ( "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rlp" - "github.com/holiman/billy" - "github.com/holiman/uint256" ) const ( diff --git a/core/txpool/blobpool/blobpool_test.go b/core/txpool/blobpool/blobpool_test.go index d658a6daf4..cbda0af798 100644 --- a/core/txpool/blobpool/blobpool_test.go +++ b/core/txpool/blobpool/blobpool_test.go @@ -29,6 +29,9 @@ import ( "testing" "time" + "github.com/holiman/billy" + "github.com/holiman/uint256" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus/misc/eip1559" "github.com/ethereum/go-ethereum/consensus/misc/eip4844" @@ -44,8 +47,6 @@ import ( "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rlp" - "github.com/holiman/billy" - "github.com/holiman/uint256" ) var ( diff --git a/eth/api_debug_test.go b/eth/api_debug_test.go index 750cee5e44..2951286663 100644 --- a/eth/api_debug_test.go +++ b/eth/api_debug_test.go @@ -25,6 +25,8 @@ import ( "testing" "github.com/davecgh/go-spew/spew" + "github.com/holiman/uint256" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/rawdb" "github.com/ethereum/go-ethereum/core/state" @@ -32,7 +34,6 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/triedb" - "github.com/holiman/uint256" ) var dumper = spew.ConfigState{Indent: " "} diff --git a/eth/catalyst/api_test.go b/eth/catalyst/api_test.go index 64e6684be1..9f6287e5f6 100644 --- a/eth/catalyst/api_test.go +++ b/eth/catalyst/api_test.go @@ -28,6 +28,8 @@ import ( "testing" "time" + "github.com/mattn/go-colorable" + "github.com/ethereum/go-ethereum/beacon/engine" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" @@ -48,7 +50,6 @@ import ( "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/trie" - "github.com/mattn/go-colorable" ) var ( diff --git a/internal/era/accumulator.go b/internal/era/accumulator.go index 2ece2755e1..9650a95de3 100644 --- a/internal/era/accumulator.go +++ b/internal/era/accumulator.go @@ -21,8 +21,9 @@ import ( "fmt" "math/big" - "github.com/ethereum/go-ethereum/common" ssz "github.com/ferranbt/fastssz" + + "github.com/ethereum/go-ethereum/common" ) // ComputeAccumulator calculates the SSZ hash tree root of the Era1 diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 1c3cb4adf9..2279cc405a 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -26,6 +26,9 @@ import ( "time" "github.com/davecgh/go-spew/spew" + "github.com/holiman/uint256" + "github.com/tyler-smith/go-bip39" + "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/accounts/scwallet" @@ -48,8 +51,6 @@ import ( "github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/trie" - "github.com/holiman/uint256" - "github.com/tyler-smith/go-bip39" ) // estimateGasErrorRatio is the amount of overestimation eth_estimateGas is diff --git a/node/api_test.go b/node/api_test.go index 8761c4883e..6c2968f991 100644 --- a/node/api_test.go +++ b/node/api_test.go @@ -25,8 +25,9 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/rpc" "github.com/stretchr/testify/assert" + + "github.com/ethereum/go-ethereum/rpc" ) // This test uses the admin_startRPC and admin_startWS APIs, diff --git a/params/config_test.go b/params/config_test.go index fa444a1d0b..90d148974f 100644 --- a/params/config_test.go +++ b/params/config_test.go @@ -22,8 +22,9 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common/math" "github.com/stretchr/testify/require" + + "github.com/ethereum/go-ethereum/common/math" ) func TestCheckCompatible(t *testing.T) { diff --git a/signer/storage/aes_gcm_storage_test.go b/signer/storage/aes_gcm_storage_test.go index b895269f95..b77f3f8472 100644 --- a/signer/storage/aes_gcm_storage_test.go +++ b/signer/storage/aes_gcm_storage_test.go @@ -24,9 +24,10 @@ import ( "os" "testing" + "github.com/mattn/go-colorable" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" - "github.com/mattn/go-colorable" ) func TestEncryption(t *testing.T) {