Skip to content

Commit f240a34

Browse files
authored
fix(anvil): use saturating_to when check for req funds (#10503)
1 parent a31d9be commit f240a34

File tree

1 file changed

+1
-1
lines changed
  • crates/anvil/src/eth/backend/mem

1 file changed

+1
-1
lines changed

crates/anvil/src/eth/backend/mem/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3116,7 +3116,7 @@ impl TransactionValidator for Backend {
31163116
}
31173117
_ => {
31183118
// check sufficient funds: `gas * price + value`
3119-
let req_funds = max_cost.checked_add(value.to()).ok_or_else(|| {
3119+
let req_funds = max_cost.checked_add(value.saturating_to()).ok_or_else(|| {
31203120
warn!(target: "backend", "[{:?}] cost too high", tx.hash());
31213121
InvalidTransactionError::InsufficientFunds
31223122
})?;

0 commit comments

Comments
 (0)