Skip to content

Commit

Permalink
Priority should not be negative
Browse files Browse the repository at this point in the history
  • Loading branch information
yzang2019 committed Jul 26, 2024
1 parent d1edfbb commit 0b6e9a5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions x/evm/ante/fee.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ func (fc EVMFeeCheckDecorator) CalculatePriority(ctx sdk.Context, txData ethtx.T
priority := sdk.NewDecFromBigInt(gp).Quo(fc.evmKeeper.GetPriorityNormalizer(ctx)).TruncateInt().BigInt()
if priority.Cmp(big.NewInt(antedecorators.MaxPriority)) > 0 {
priority = big.NewInt(antedecorators.MaxPriority)
} else if priority.Sign() < 0 {
priority = big.NewInt(0)

Check warning on line 128 in x/evm/ante/fee.go

View check run for this annotation

Codecov / codecov/patch

x/evm/ante/fee.go#L128

Added line #L128 was not covered by tests
}
return priority
}

0 comments on commit 0b6e9a5

Please sign in to comment.