diff --git a/x/evm/handler.go b/x/evm/handler.go index 9868d31a0d..4f8fcae549 100644 --- a/x/evm/handler.go +++ b/x/evm/handler.go @@ -128,7 +128,7 @@ func handleMsgEthereumTx(ctx sdk.Context, k *Keeper, msg types.MsgEthereumTx) (* k.Bloom.Or(k.Bloom, executionResult.Bloom) // update transaction logs in KVStore - err = k.SetLogs(ctx, common.BytesToHash(txHash), executionResult.Logs) + err = k.SetLogs(ctx.WithGasMeter(sdk.NewInfiniteGasMeter()), common.BytesToHash(txHash), executionResult.Logs) if err != nil { panic(err) } @@ -225,7 +225,7 @@ func handleMsgEthermint(ctx sdk.Context, k *Keeper, msg types.MsgEthermint) (*sd k.Bloom.Or(k.Bloom, executionResult.Bloom) // update transaction logs in KVStore - err = k.SetLogs(ctx, common.BytesToHash(txHash), executionResult.Logs) + err = k.SetLogs(ctx.WithGasMeter(sdk.NewInfiniteGasMeter()), common.BytesToHash(txHash), executionResult.Logs) if err != nil { panic(err) } diff --git a/x/evm/handler_test.go b/x/evm/handler_test.go index 4558393ee8..e2d16c82ca 100644 --- a/x/evm/handler_test.go +++ b/x/evm/handler_test.go @@ -450,9 +450,12 @@ func (suite *EvmTestSuite) TestSendTransaction() { err = tx.Sign(big.NewInt(3), priv.ToECDSA()) suite.Require().NoError(err) + suite.ctx = suite.ctx.WithGasMeter(sdk.NewInfiniteGasMeter()) result, err := suite.handler(suite.ctx, tx) suite.Require().NoError(err) suite.Require().NotNil(result) + var expectedGas uint64 = 5387 + suite.Require().EqualValues(expectedGas, suite.ctx.GasMeter().GasConsumed()) } func (suite *EvmTestSuite) TestOutOfGasWhenDeployContract() {