diff --git a/x/evm/handler_test.go b/x/evm/handler_test.go index e80791bea9..aee29fac48 100644 --- a/x/evm/handler_test.go +++ b/x/evm/handler_test.go @@ -470,16 +470,9 @@ func (suite *EvmTestSuite) TestOutOfGasWhenDeployContract() { tx := types.NewTx(suite.chainID, 1, nil, big.NewInt(0), gasLimit, gasPrice, nil, nil, bytecode, nil) suite.SignTx(tx) - defer func() { - if r := recover(); r != nil { - // TODO: snapshotting logic - } else { - suite.Require().Fail("panic did not happen") - } - }() + _, err := suite.handler(suite.ctx, tx) - suite.handler(suite.ctx, tx) - suite.Require().Fail("panic did not happen") + suite.Require().Equal("failed to apply transaction: failed to apply ethereum core message: apply message: intrinsic gas too low", err.Error(), "correct error") } func (suite *EvmTestSuite) TestErrorWhenDeployContract() { diff --git a/x/evm/keeper/state_transition.go b/x/evm/keeper/state_transition.go index 39014b015f..fb9a082e50 100644 --- a/x/evm/keeper/state_transition.go +++ b/x/evm/keeper/state_transition.go @@ -369,7 +369,7 @@ func (k *Keeper) ApplyMessageWithConfig(ctx sdk.Context, msg core.Message, trace } leftoverGas := msg.Gas() - intrinsicGas - // access list preparaion is moved from ante handler to here, because it's needed when `ApplyMessage` is called + // access list preparation is moved from ante handler to here, because it's needed when `ApplyMessage` is called // under contexts where ante handlers are not run, for example `eth_call` and `eth_estimateGas`. if rules := cfg.ChainConfig.Rules(big.NewInt(ctx.BlockHeight()), cfg.ChainConfig.MergeForkBlock != nil); rules.IsBerlin { stateDB.PrepareAccessList(msg.From(), msg.To(), vm.ActivePrecompiles(rules), msg.AccessList())