Skip to content

Commit

Permalink
fix: use correct rpc errors (#11463)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Oct 3, 2024
1 parent a0867a6 commit 7d092a2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions crates/rpc/rpc-eth-types/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,14 @@ impl From<revm::primitives::InvalidTransaction> for RpcInvalidTransactionError {
InvalidTransaction::InvalidChainId => Self::InvalidChainId,
InvalidTransaction::PriorityFeeGreaterThanMaxFee => Self::TipAboveFeeCap,
InvalidTransaction::GasPriceLessThanBasefee => Self::FeeCapTooLow,
InvalidTransaction::CallerGasLimitMoreThanBlock |
InvalidTransaction::CallGasCostMoreThanGasLimit => Self::GasTooHigh,
InvalidTransaction::CallerGasLimitMoreThanBlock => {
// tx.gas > block.gas_limit
Self::GasTooHigh
}
InvalidTransaction::CallGasCostMoreThanGasLimit => {
// tx.gas < cost
Self::GasTooLow
}
InvalidTransaction::RejectCallerWithCode => Self::SenderNoEOA,
InvalidTransaction::LackOfFundForMaxFee { fee, balance } => {
Self::InsufficientFunds { cost: *fee, balance: *balance }
Expand Down

0 comments on commit 7d092a2

Please sign in to comment.