From a75eb71e4823430cc693f9d9385fc74b23988356 Mon Sep 17 00:00:00 2001 From: Arpit Temani Date: Mon, 12 Dec 2022 02:52:50 +0530 Subject: [PATCH] fix linters --- internal/cli/server/config_test.go | 6 ++++++ miner/worker.go | 3 +++ 2 files changed, 9 insertions(+) diff --git a/internal/cli/server/config_test.go b/internal/cli/server/config_test.go index 5f3118996b..c444ee7b98 100644 --- a/internal/cli/server/config_test.go +++ b/internal/cli/server/config_test.go @@ -102,6 +102,8 @@ func TestDefaultDatatypeOverride(t *testing.T) { } func TestConfigLoadFile(t *testing.T) { + t.Parallel() + readFile := func(path string) { config, err := readConfigFile(path) assert.NoError(t, err) @@ -124,11 +126,15 @@ func TestConfigLoadFile(t *testing.T) { // read file in hcl format t.Run("hcl", func(t *testing.T) { + t.Parallel() + readFile("./testdata/test.hcl") }) // read file in json format t.Run("json", func(t *testing.T) { + t.Parallel() + readFile("./testdata/test.json") }) } diff --git a/miner/worker.go b/miner/worker.go index 2c8cb3f790..7876c18c8a 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -920,6 +920,7 @@ func (w *worker) commitTransactions(env *environment, txs *types.TransactionsByP initialGasLimit := env.gasPool.Gas() initialTxs := txs.GetTxs() + var breakCause string defer func() { @@ -950,12 +951,14 @@ func (w *worker) commitTransactions(env *environment, txs *types.TransactionsByP inc: true, } } + breakCause = "interrupt" return atomic.LoadInt32(interrupt) == commitInterruptNewHead } // If we don't have enough gas for any further transactions then we're done if env.gasPool.Gas() < params.TxGas { log.Trace("Not enough gas for further transactions", "have", env.gasPool, "want", params.TxGas) + breakCause = "Not enough gas for further transactions" break }