Skip to content

Commit

Permalink
return bridge hook early if max gas is zero
Browse files Browse the repository at this point in the history
  • Loading branch information
beer-1 committed Nov 6, 2024
1 parent 18e45a9 commit cbb75b7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions x/opchild/keeper/deposit.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import (
)

func (k Keeper) handleBridgeHook(ctx sdk.Context, data []byte, hookMaxGas uint64) (success bool, reason string) {
if hookMaxGas == 0 {
return false, "hook max gas is zero"
}

Check warning on line 16 in x/opchild/keeper/deposit.go

View check run for this annotation

Codecov / codecov/patch

x/opchild/keeper/deposit.go#L15-L16

Added lines #L15 - L16 were not covered by tests

originGasMeter := ctx.GasMeter()
gasForHook := originGasMeter.GasRemaining()
if gasForHook > hookMaxGas {
Expand Down

0 comments on commit cbb75b7

Please sign in to comment.