Skip to content

Commit

Permalink
Update ambiguous error meaning (polkadot-evm#1216)
Browse files Browse the repository at this point in the history
  • Loading branch information
boundless-forest authored Oct 15, 2023
1 parent f6a0a0c commit 849e712
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions frame/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,12 +492,16 @@ pub mod pallet {
GasLimitTooLow,
/// Gas limit is too high.
GasLimitTooHigh,
/// Undefined error.
Undefined,
/// The chain id is invalid.
InvalidChainId,
/// the signature is invalid.
InvalidSignature,
/// EVM reentrancy
Reentrancy,
/// EIP-3607,
TransactionMustComeFromEOA,
/// Undefined error.
Undefined,
}

impl<T> From<TransactionValidationError> for Error<T> {
Expand All @@ -511,7 +515,9 @@ pub mod pallet {
TransactionValidationError::GasPriceTooLow => Error::<T>::GasPriceTooLow,
TransactionValidationError::PriorityFeeTooHigh => Error::<T>::GasPriceTooLow,
TransactionValidationError::InvalidFeeInput => Error::<T>::GasPriceTooLow,
_ => Error::<T>::Undefined,
TransactionValidationError::InvalidChainId => Error::<T>::InvalidChainId,
TransactionValidationError::InvalidSignature => Error::<T>::InvalidSignature,
TransactionValidationError::UnknownError => Error::<T>::Undefined,
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion frame/evm/src/runner/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ where
let maybe_weight_info =
WeightInfo::new_from_weight_limit(weight_limit, proof_size_base_cost).map_err(
|_| RunnerError {
error: Error::<T>::Undefined,
error: Error::<T>::GasLimitTooLow,
weight,
},
)?;
Expand Down

0 comments on commit 849e712

Please sign in to comment.