Trait InteropProvider

Source
pub trait InteropProvider {
    type Error: Error + Display;

    // Required methods
    fn header_by_number<'life0, 'async_trait>(
        &'life0 self,
        chain_id: u64,
        number: u64,
    ) -> Pin<Box<dyn Future<Output = Result<Header, Self::Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn receipts_by_number<'life0, 'async_trait>(
        &'life0 self,
        chain_id: u64,
        number: u64,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<OpReceiptEnvelope>, Self::Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn receipts_by_hash<'life0, 'async_trait>(
        &'life0 self,
        chain_id: u64,
        block_hash: FixedBytes<32>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<OpReceiptEnvelope>, Self::Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
}
Expand description

Describes the interface of the interop data provider. This provider is multiplexed over several chains, with each method consuming a chain ID to determine the target chain.

Required Associated Types§

Source

type Error: Error + Display

The error type for the provider.

Required Methods§

Source

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

Fetch a Header by its number.

Source

fn receipts_by_number<'life0, 'async_trait>( &'life0 self, chain_id: u64, number: u64, ) -> Pin<Box<dyn Future<Output = Result<Vec<OpReceiptEnvelope>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Fetch all receipts for a given block by number.

Source

fn receipts_by_hash<'life0, 'async_trait>( &'life0 self, chain_id: u64, block_hash: FixedBytes<32>, ) -> Pin<Box<dyn Future<Output = Result<Vec<OpReceiptEnvelope>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Fetch all receipts for a given block by hash.

Implementors§