Skip to content

Commit

Permalink
Merge branch 'dev' into fix-precision-error
Browse files Browse the repository at this point in the history
  • Loading branch information
KamiD authored Jan 26, 2021
2 parents fa2b1f5 + fbd5a75 commit 1aaeb0c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 2 additions & 0 deletions x/evm/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ func handleMsgEthereumTx(ctx sdk.Context, k *Keeper, msg types.MsgEthereumTx) (*
if refundErr != nil {
panic(refundErr)
}
st.Csdb.WithContext(ctx.WithGasMeter(sdk.NewInfiniteGasMeter())).UpdateAccounts()
}
}()

Expand Down Expand Up @@ -195,6 +196,7 @@ func handleMsgEthermint(ctx sdk.Context, k *Keeper, msg types.MsgEthermint) (*sd
if refundErr != nil {
panic(refundErr)
}
st.Csdb.WithContext(ctx.WithGasMeter(sdk.NewInfiniteGasMeter())).UpdateAccounts()
}
}()

Expand Down
2 changes: 0 additions & 2 deletions x/evm/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -637,8 +637,6 @@ func (suite *EvmTestSuite) TestRefundGas() {
gasLeft := big.NewInt(1).SetUint64(gasLimit - suite.ctx.GasMeter().GasConsumed())
gasRefund := big.NewInt(1).Mul(gasPrice, gasLeft)

suite.app.EvmKeeper.UpdateAccounts(suite.ctx)

balanceAfterHandler := big.NewInt(1).Sub(userBalance, tc.consumed)
balanceAfterRefund := suite.app.EvmKeeper.GetBalance(suite.ctx, sender)

Expand Down
2 changes: 0 additions & 2 deletions x/evm/types/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,6 @@ func (st StateTransition) TransitionDb(ctx sdk.Context, config ChainConfig) (*Ex
},
}

// TODO: Refund unused gas here, if intended in future

// Consume gas from evm execution
// Out of gas check does not need to be done here since it is done within the EVM execution
ctx.WithGasMeter(currentGasMeter).GasMeter().ConsumeGas(gasConsumed, "EVM execution consumption")
Expand Down

0 comments on commit 1aaeb0c

Please sign in to comment.