pub struct EVMBlockFilter<T> {
pub _client: PhantomData<T>,
}
Expand description
Filter implementation for EVM-compatible blockchains
Fields§
§_client: PhantomData<T>
Implementations§
Source§impl<T> EVMBlockFilter<T>
impl<T> EVMBlockFilter<T>
Sourcepub fn find_matching_transaction(
&self,
tx_status: &TransactionStatus,
transaction: &EVMTransaction,
tx_receipt: &Option<EVMTransactionReceipt>,
monitor: &Monitor,
matched_transactions: &mut Vec<TransactionCondition>,
)
pub fn find_matching_transaction( &self, tx_status: &TransactionStatus, transaction: &EVMTransaction, tx_receipt: &Option<EVMTransactionReceipt>, monitor: &Monitor, matched_transactions: &mut Vec<TransactionCondition>, )
Finds transactions that match the monitor’s conditions.
§Arguments
tx_status
- Status of the transaction (success/failure)transaction
- The transaction to checktx_receipt
- Transaction receiptmonitor
- Monitor containing match conditionsmatched_transactions
- Vector to store matching transactions
Sourcepub fn find_matching_functions_for_transaction(
&self,
contract_specs: &[(String, EVMContractSpec)],
transaction: &EVMTransaction,
monitor: &Monitor,
matched_functions: &mut Vec<FunctionCondition>,
matched_on_args: &mut EVMMatchArguments,
)
pub fn find_matching_functions_for_transaction( &self, contract_specs: &[(String, EVMContractSpec)], transaction: &EVMTransaction, monitor: &Monitor, matched_functions: &mut Vec<FunctionCondition>, matched_on_args: &mut EVMMatchArguments, )
Finds function calls in a transaction that match the monitor’s conditions.
Decodes the transaction input data using the contract ABI and matches against the monitor’s function conditions.
§Arguments
contract_specs
- List of contract specificationstransaction
- The transaction containing the function callmonitor
- Monitor containing function match conditionsmatched_functions
- Vector to store matching functionsmatched_on_args
- Arguments from matched function calls
Sourcepub async fn find_matching_events_for_transaction(
&self,
logs: &[EVMReceiptLog],
monitor: &Monitor,
matched_events: &mut Vec<EventCondition>,
matched_on_args: &mut EVMMatchArguments,
involved_addresses: &mut Vec<String>,
)
pub async fn find_matching_events_for_transaction( &self, logs: &[EVMReceiptLog], monitor: &Monitor, matched_events: &mut Vec<EventCondition>, matched_on_args: &mut EVMMatchArguments, involved_addresses: &mut Vec<String>, )
Finds events in a transaction receipt that match the monitor’s conditions.
Processes event logs from the transaction receipt and matches them against the monitor’s event conditions.
§Arguments
logs
- Transaction receipt containing event logsmonitor
- Monitor containing event match conditionsmatched_events
- Vector to store matching eventsmatched_on_args
- Arguments from matched eventsinvolved_addresses
- Addresses involved in matched events
Sourcepub fn evaluate_expression(
&self,
expression: &str,
args: &Option<Vec<EVMMatchParamEntry>>,
) -> bool
pub fn evaluate_expression( &self, expression: &str, args: &Option<Vec<EVMMatchParamEntry>>, ) -> bool
Sourcepub async fn decode_events(
&self,
abi: &ContractSpec,
log: &EVMReceiptLog,
) -> Option<EVMMatchParamsMap>
pub async fn decode_events( &self, abi: &ContractSpec, log: &EVMReceiptLog, ) -> Option<EVMMatchParamsMap>
Trait Implementations§
Source§impl<T: BlockChainClient + EvmClientTrait> BlockFilter for EVMBlockFilter<T>
impl<T: BlockChainClient + EvmClientTrait> BlockFilter for EVMBlockFilter<T>
Source§fn filter_block<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
client: &'life1 T,
network: &'life2 Network,
block: &'life3 BlockType,
monitors: &'life4 [Monitor],
contract_specs: Option<&'life5 [(String, ContractSpec)]>,
) -> Pin<Box<dyn Future<Output = Result<Vec<MonitorMatch>, FilterError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
fn filter_block<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
client: &'life1 T,
network: &'life2 Network,
block: &'life3 BlockType,
monitors: &'life4 [Monitor],
contract_specs: Option<&'life5 [(String, ContractSpec)]>,
) -> Pin<Box<dyn Future<Output = Result<Vec<MonitorMatch>, FilterError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
type Client = T
Auto Trait Implementations§
impl<T> Freeze for EVMBlockFilter<T>
impl<T> RefUnwindSafe for EVMBlockFilter<T>where
T: RefUnwindSafe,
impl<T> Send for EVMBlockFilter<T>where
T: Send,
impl<T> Sync for EVMBlockFilter<T>where
T: Sync,
impl<T> Unpin for EVMBlockFilter<T>where
T: Unpin,
impl<T> UnwindSafe for EVMBlockFilter<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Chain<T> for T
impl<T> Chain<T> for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more