fix linters

This commit is contained in:
Arpit Temani 2022-12-12 02:52:50 +05:30
parent abed2a501a
commit a75eb71e48
2 changed files with 9 additions and 0 deletions

View file

@ -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")
})
}

View file

@ -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
}