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 Sep 11, 2023
1 parent 07cf3bd commit 777cabe
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 @@ -1051,13 +1051,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 777cabe

Please sign in to comment.