From da225ccbaf501ffe88f03f9a6aad0bb6e04d4c4b Mon Sep 17 00:00:00 2001 From: Lindsey Gray Date: Fri, 29 Dec 2023 16:40:48 -0600 Subject: [PATCH] satisfy linter --- eth/api_miner.go | 2 +- eth/downloader/downloader.go | 6 +++--- eth/ethconfig/config.go | 18 +++++++++--------- graphql/graphql_test.go | 6 +++--- internal/ethapi/api.go | 2 +- miner/stress/1559/main.go | 2 +- miner/stress/ethash/main.go | 2 +- miner/worker_test.go | 1 - 8 files changed, 19 insertions(+), 20 deletions(-) diff --git a/eth/api_miner.go b/eth/api_miner.go index 9a0767a269..f2e31ccc7c 100644 --- a/eth/api_miner.go +++ b/eth/api_miner.go @@ -41,7 +41,7 @@ func NewMinerAPI(e *Ethereum) *MinerAPI { // number of threads allowed to use and updates the minimum price required by the // transaction pool. func (api *MinerAPI) Start(threads *int) error { - if threads == nil { + if threads == nil { return api.e.StartMining(runtime.NumCPU()) } return api.e.StartMining(*threads) diff --git a/eth/downloader/downloader.go b/eth/downloader/downloader.go index 2336a82f42..f604601d43 100644 --- a/eth/downloader/downloader.go +++ b/eth/downloader/downloader.go @@ -1275,10 +1275,10 @@ func (d *Downloader) fetchReceipts(from uint64, beaconMode bool) error { // queue until the stream ends or a failure occurs. func (d *Downloader) processHeaders(origin uint64, td, ttd *big.Int, beaconMode bool) error { var ( - rollback uint64 // Zero means no rollback (fine as you can't unroll the genesis) + rollback uint64 // Zero means no rollback (fine as you can't unroll the genesis) rollbackErr error - mode = d.getMode() - gotHeaders = false // Wait for batches of headers to process + mode = d.getMode() + gotHeaders = false // Wait for batches of headers to process ) defer func() { if rollback > 0 { diff --git a/eth/ethconfig/config.go b/eth/ethconfig/config.go index a52cb5f381..d1444c74ef 100644 --- a/eth/ethconfig/config.go +++ b/eth/ethconfig/config.go @@ -53,16 +53,16 @@ var FullNodeGPO = gasprice.Config{ // Defaults contains default settings for use on the Ethereum main net. var Defaults = Config{ - SyncMode: downloader.SnapSync, + SyncMode: downloader.SnapSync, Ethash: ethash.Config{ - CacheDir: "ethash", - CachesInMem: 2, - CachesOnDisk: 3, - CachesLockMmap: false, - DatasetsInMem: 1, - DatasetsOnDisk: 2, - DatasetsLockMmap: false, - }, + CacheDir: "ethash", + CachesInMem: 2, + CachesOnDisk: 3, + CachesLockMmap: false, + DatasetsInMem: 1, + DatasetsOnDisk: 2, + DatasetsLockMmap: false, + }, NetworkId: 0, // enable auto configuration of networkID == chainID TxLookupLimit: 2350000, TransactionHistory: 2350000, diff --git a/graphql/graphql_test.go b/graphql/graphql_test.go index f04456a5d9..e5ae9f8928 100644 --- a/graphql/graphql_test.go +++ b/graphql/graphql_test.go @@ -446,10 +446,10 @@ func createNode(t *testing.T) *node.Node { func newGQLService(t *testing.T, stack *node.Node, shanghai bool, gspec *core.Genesis, genBlocks int, genfunc func(i int, gen *core.BlockGen)) (*handler, []*types.Block) { ethConf := ðconfig.Config{ - Genesis: gspec, + Genesis: gspec, Ethash: ethash.Config{ - PowMode: ethash.ModeFake, - }, + PowMode: ethash.ModeFake, + }, NetworkId: 1337, TrieCleanCache: 5, TrieDirtyCache: 5, diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index e4fd6e604b..cca786a29c 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -34,8 +34,8 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/common/math" "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/consensus/misc/eip1559" "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/consensus/misc/eip1559" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" diff --git a/miner/stress/1559/main.go b/miner/stress/1559/main.go index 23874cb138..00061d0c8d 100644 --- a/miner/stress/1559/main.go +++ b/miner/stress/1559/main.go @@ -49,7 +49,7 @@ var ( ) func main() { - log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stderr, log.LevelInfo, true))) + log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stderr, log.LevelInfo, true))) fdlimit.Raise(2048) // Generate a batch of accounts to seal and fund with diff --git a/miner/stress/ethash/main.go b/miner/stress/ethash/main.go index 8dff4cdbc9..db92d77e23 100644 --- a/miner/stress/ethash/main.go +++ b/miner/stress/ethash/main.go @@ -44,7 +44,7 @@ import ( ) func main() { - log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stderr, log.LevelInfo, true))) + log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stderr, log.LevelInfo, true))) fdlimit.Raise(2048) // Generate a batch of accounts to seal and fund with diff --git a/miner/worker_test.go b/miner/worker_test.go index d533ca0871..f9d495003f 100644 --- a/miner/worker_test.go +++ b/miner/worker_test.go @@ -166,7 +166,6 @@ func newTestWorker(t *testing.T, chainConfig *params.ChainConfig, engine consens return w, backend } - func TestGenerateBlockAndImportEthash(t *testing.T) { testGenerateBlockAndImport(t, false) }