From 777cabefbb90d2b00c4dedfb7d0964e097678726 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Mon, 11 Sep 2023 07:21:01 +0000 Subject: [PATCH] docs: add documentation to `OnCheckEvmTransaction` trait --- frame/evm/src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/frame/evm/src/lib.rs b/frame/evm/src/lib.rs index d01faaae1d..804e907cbf 100644 --- a/frame/evm/src/lib.rs +++ b/frame/evm/src/lib.rs @@ -1051,13 +1051,20 @@ impl OnCreate for Tuple { } } +/// Implements additional EVM transaction validation logic pub trait OnCheckEvmTransaction { + /// 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 OnCheckEvmTransaction for () { fn on_check_evm_transaction( _v: &mut CheckEvmTransaction,