openzeppelin_monitor::services::blockwatcher

Function process_new_blocks

Source
pub async fn process_new_blocks<S: BlockStorage, C: BlockChainClient + Send + Clone + 'static, H: Fn(BlockType, Network) -> BoxFuture<'static, ProcessedBlock> + Send + Sync + 'static, T: Fn(&ProcessedBlock) -> JoinHandle<()> + Send + Sync + 'static, TR: BlockTrackerTrait<S>>(
    network: &Network,
    rpc_client: &C,
    block_storage: Arc<S>,
    block_handler: Arc<H>,
    trigger_handler: Arc<T>,
    block_tracker: Arc<TR>,
) -> Result<(), BlockWatcherError>
Expand description

Processes new blocks for a network

§Arguments

  • network - Network configuration
  • rpc_client - RPC client for the network
  • block_storage - Storage implementation for blocks
  • block_handler - Handler function for processed blocks
  • trigger_handler - Handler function for processed blocks
  • block_tracker - Tracker implementation for block processing

§Returns

  • Result<(), BlockWatcherError> - Success or error