Skip to content

Commit

Permalink
docs: add documentation to OnCheckEvmTransaction trait
Browse files Browse the repository at this point in the history
  • Loading branch information
Grigoriy Simonov committed Oct 17, 2023
1 parent 213a8c6 commit 23b2427
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions frame/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1094,13 +1094,20 @@ impl<T> OnCreate<T> for Tuple {
}
}

/// Implements additional EVM transaction validation logic
pub trait OnCheckEvmTransaction<T: Config> {
/// Validate EVM transaction.
///
/// This method should be called before frontier's built-in validations.
///
/// - `v`: Transaction data to validate. Method can modify transaction data before frontier's built-in validations.
fn on_check_evm_transaction(
v: &mut CheckEvmTransaction,
origin: &H160,
) -> Result<(), TransactionValidationError>;
}

/// Implementation for () does not specify any additional validations.
impl<T: Config> OnCheckEvmTransaction<T> for () {
fn on_check_evm_transaction(
_v: &mut CheckEvmTransaction,
Expand Down

0 comments on commit 23b2427

Please sign in to comment.