kona_derive_alloy::prelude

Trait ChainProvider

Source
pub trait ChainProvider {
    type Error: Display + ToString + Into<PipelineErrorKind>;

    // Required methods
    fn header_by_hash<'life0, 'async_trait>(
        &'life0 mut self,
        hash: FixedBytes<32>,
    ) -> Pin<Box<dyn Future<Output = Result<Header, Self::Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn block_info_by_number<'life0, 'async_trait>(
        &'life0 mut self,
        number: u64,
    ) -> Pin<Box<dyn Future<Output = Result<BlockInfo, Self::Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn receipts_by_hash<'life0, 'async_trait>(
        &'life0 mut self,
        hash: FixedBytes<32>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Receipt>, Self::Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn block_info_and_transactions_by_hash<'life0, 'async_trait>(
        &'life0 mut self,
        hash: FixedBytes<32>,
    ) -> Pin<Box<dyn Future<Output = Result<(BlockInfo, Vec<TxEnvelope>), Self::Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
}
Expand description

Describes the functionality of a data source that can provide information from the blockchain.

Required Associated Types§

Source

type Error: Display + ToString + Into<PipelineErrorKind>

The error type for the ChainProvider.

Required Methods§

Source

fn header_by_hash<'life0, 'async_trait>( &'life0 mut self, hash: FixedBytes<32>, ) -> Pin<Box<dyn Future<Output = Result<Header, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Fetch the L1 Header for the given B256 hash.

Source

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

Returns the block at the given number, or an error if the block does not exist in the data source.

Source

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

Returns all receipts in the block with the given hash, or an error if the block does not exist in the data source.

Source

fn block_info_and_transactions_by_hash<'life0, 'async_trait>( &'life0 mut self, hash: FixedBytes<32>, ) -> Pin<Box<dyn Future<Output = Result<(BlockInfo, Vec<TxEnvelope>), Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Returns the BlockInfo and list of TxEnvelopes from the given block hash.

Implementors§