openzeppelin_monitor::utils::monitor::execution

Function execute_monitor

Source
pub async fn execute_monitor<M: MonitorRepositoryTrait<N, TR>, N: NetworkRepositoryTrait + Send + Sync + 'static, TR: TriggerRepositoryTrait + Send + Sync + 'static, CP: ClientPoolTrait + Send + Sync + 'static>(
    config: MonitorExecutionConfig<M, N, TR, CP>,
) -> ExecutionResult<String>
Expand description

Executes a monitor against a specific block number on a blockchain network.

This function allows testing monitors by running them against historical blocks. It supports both EVM and Stellar networks, retrieving the block data and applying the monitor’s filters to check for matches.

§Arguments

  • monitor_name - The name of the monitor to execute
  • network_slug - The network identifier to run the monitor against
  • block_number - The specific block number to analyze
  • active_monitors - List of currently active monitors
  • network_service - The network service to use
  • filter_service - The filter service to use
  • client_pool - The client pool to use

§Returns

  • Result<String, ExecutionError> - JSON string containing matches or error