Skip to content

Commit

Permalink
check maxGasWanted
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Jun 26, 2024
1 parent f2fdf11 commit 752301e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/ante/eth.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,12 @@ func CheckEthGasConsume(
}

// We can't trust the tx gas limit, because we'll refund the unused gas.
gasWanted += min(msgEthTx.GetGas(), maxGasWanted)

gasLimit := msgEthTx.GetGas()
if maxGasWanted != 0 {
gasWanted += min(gasLimit, maxGasWanted)

Check warning on line 128 in app/ante/eth.go

View check run for this annotation

Codecov / codecov/patch

app/ante/eth.go#L128

Added line #L128 was not covered by tests
} else {
gasWanted += gasLimit
}
// user balance is already checked during CheckTx so there's no need to
// verify it again during ReCheckTx
if ctx.IsReCheckTx() {
Expand Down

0 comments on commit 752301e

Please sign in to comment.