op_alloy_protocol

Trait BatchValidationProvider

Source
pub trait BatchValidationProvider {
    type Error: Display + ToString;

    // Required methods
    fn l2_block_info_by_number<'life0, 'async_trait>(
        &'life0 mut self,
        number: u64,
    ) -> Pin<Box<dyn Future<Output = Result<L2BlockInfo, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn block_by_number<'life0, 'async_trait>(
        &'life0 mut self,
        number: u64,
    ) -> Pin<Box<dyn Future<Output = Result<OpBlock, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Describes the functionality of a data source that fetches safe blocks.

Required Associated Types§

Source

type Error: Display + ToString

The error type for the BatchValidationProvider.

Required Methods§

Source

fn l2_block_info_by_number<'life0, 'async_trait>( &'life0 mut self, number: u64, ) -> Pin<Box<dyn Future<Output = Result<L2BlockInfo, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the L2BlockInfo given a block number.

Errors if the block does not exist.

Source

fn block_by_number<'life0, 'async_trait>( &'life0 mut self, number: u64, ) -> Pin<Box<dyn Future<Output = Result<OpBlock, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the OpBlock for a given number.

Errors if no block is available for the given block number.

Implementors§