Skip to content

Commit

Permalink
add new InvalidTransaction error variant
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadkaouk committed Jan 26, 2024
1 parent 35ebd17 commit 1354932
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frame/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,8 @@ pub mod pallet {
Reentrancy,
/// EIP-3607,
TransactionMustComeFromEOA,
/// Invalid Transaction
InvalidTransaction,
/// Undefined error.
Undefined,
}
Expand Down Expand Up @@ -1040,7 +1042,7 @@ where
let adjusted_paid = paid
.offset(refund_imbalance)
.same()
.map_err(|_| Error::<T>::Undefined)?;
.map_err(|_| Error::<T>::InvalidTransaction)?;

let (base_fee, tip) = adjusted_paid.split(base_fee.unique_saturated_into());
// Handle base fee. Can be either burned, rationed, etc ...
Expand Down Expand Up @@ -1123,7 +1125,7 @@ where
let adjusted_paid = paid
.offset(refund_imbalance)
.same()
.unwrap_or_else(|_| Credit::<T::AccountId, F>::zero());
.map_err(|_| Error::<T>::InvalidTransaction)?;

let (base_fee, tip) = adjusted_paid.split(base_fee.unique_saturated_into());
// Handle base fee. Can be either burned, rationed, etc ...
Expand Down

0 comments on commit 1354932

Please sign in to comment.