pub struct ContractEventHandlers<T, Db> { /* private fields */ }
Expand description
Event handling an object for on-chain operations
Once an on-chain operation is recorded by the crate::block::Indexer, it is pre-processed and passed on to this object that handles event-specific actions for each on-chain operation.
Implementations§
Source§impl<T, Db> ContractEventHandlers<T, Db>
impl<T, Db> ContractEventHandlers<T, Db>
Sourcepub fn new(
addresses: ContractAddresses,
safe_address: Address,
chain_key: ChainKeypair,
db: Db,
rpc_operations: T,
) -> Self
pub fn new( addresses: ContractAddresses, safe_address: Address, chain_key: ChainKeypair, db: Db, rpc_operations: T, ) -> Self
Creates a new instance of contract event handlers with RPC operations support.
This constructor initializes the event handlers with all necessary dependencies for processing blockchain events and making direct RPC calls for fresh state data.
§Type Parameters
T
- Type implementingHoprIndexerRpcOperations
for blockchain queries
§Arguments
addresses
- Contract addresses configurationsafe_address
- The node’s safe address for filtering relevant eventschain_key
- Cryptographic key for chain operationsdb
- Database connection for persistent storagerpc_operations
- RPC interface for direct blockchain queries
§Returns
Self
- New instance ofContractEventHandlers
Trait Implementations§
Source§impl<T, Db> ChainLogHandler for ContractEventHandlers<T, Db>where
T: HoprIndexerRpcOperations + Clone + Send + Sync + 'static,
Db: HoprDbAllOperations + Clone + Debug + Send + Sync + 'static,
impl<T, Db> ChainLogHandler for ContractEventHandlers<T, Db>where
T: HoprIndexerRpcOperations + Clone + Send + Sync + 'static,
Db: HoprDbAllOperations + Clone + Debug + Send + Sync + 'static,
fn contract_addresses(&self) -> Vec<Address>
Source§fn contract_addresses_map(&self) -> Arc<ContractAddresses>
fn contract_addresses_map(&self) -> Arc<ContractAddresses>
Returns the mapping of contract types to their deployed addresses. Read more
Source§fn safe_address(&self) -> Address
fn safe_address(&self) -> Address
Returns the safe address for this HOPR node. Read more
Source§fn contract_address_topics(&self, contract: Address) -> Vec<B256> ⓘ
fn contract_address_topics(&self, contract: Address) -> Vec<B256> ⓘ
Returns the event signature topics for efficient log filtering. Read more
Source§fn collect_log_event<'life0, 'async_trait>(
&'life0 self,
slog: SerializableLog,
is_synced: bool,
) -> Pin<Box<dyn Future<Output = Result<Option<SignificantChainEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn collect_log_event<'life0, 'async_trait>(
&'life0 self,
slog: SerializableLog,
is_synced: bool,
) -> Pin<Box<dyn Future<Output = Result<Option<SignificantChainEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Processes a single blockchain log and extracts significant events. Read more
Source§impl<T: Clone, Db: Clone> Clone for ContractEventHandlers<T, Db>
impl<T: Clone, Db: Clone> Clone for ContractEventHandlers<T, Db>
Source§fn clone(&self) -> ContractEventHandlers<T, Db>
fn clone(&self) -> ContractEventHandlers<T, Db>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<T, Db> Freeze for ContractEventHandlers<T, Db>
impl<T, Db> RefUnwindSafe for ContractEventHandlers<T, Db>where
Db: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, Db> Send for ContractEventHandlers<T, Db>
impl<T, Db> Sync for ContractEventHandlers<T, Db>
impl<T, Db> Unpin for ContractEventHandlers<T, Db>
impl<T, Db> UnwindSafe for ContractEventHandlers<T, Db>where
Db: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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> 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