reth_provider

Trait BlockBodyReader

pub trait BlockBodyReader<Provider> {
    type Block: Block;

    // Required method
    fn read_block_bodies(
        &self,
        provider: &Provider,
        inputs: Vec<(&<Self::Block as Block>::Header, Vec<<<Self::Block as Block>::Body as BlockBody>::Transaction>)>,
    ) -> Result<Vec<<Self::Block as Block>::Body>, ProviderError>;
}
Expand description

Trait that implements how block bodies are read from the storage.

Note: Within the current abstraction, transactions persistence is handled separately, thus this trait is provided with transactions read beforehand and is expected to construct the block body from those transactions and additional data read from elsewhere.

Required Associated Types§

type Block: Block

The block type.

Required Methods§

fn read_block_bodies( &self, provider: &Provider, inputs: Vec<(&<Self::Block as Block>::Header, Vec<<<Self::Block as Block>::Body as BlockBody>::Transaction>)>, ) -> Result<Vec<<Self::Block as Block>::Body>, ProviderError>

Receives a list of block headers along with block transactions and returns the block bodies.

Implementations on Foreign Types§

§

impl<'a, Provider, T> BlockBodyReader<Provider> for &'a T
where T: 'a + BlockBodyReader<Provider> + ?Sized,

§

type Block = <T as BlockBodyReader<Provider>>::Block

§

fn read_block_bodies( &self, provider: &Provider, inputs: Vec<(&<<&'a T as BlockBodyReader<Provider>>::Block as Block>::Header, Vec<<<<&'a T as BlockBodyReader<Provider>>::Block as Block>::Body as BlockBody>::Transaction>)>, ) -> Result<Vec<<<&'a T as BlockBodyReader<Provider>>::Block as Block>::Body>, ProviderError>

§

impl<Provider, T> BlockBodyReader<Provider> for Arc<T>
where T: BlockBodyReader<Provider> + ?Sized,

§

type Block = <T as BlockBodyReader<Provider>>::Block

§

fn read_block_bodies( &self, provider: &Provider, inputs: Vec<(&<<Arc<T> as BlockBodyReader<Provider>>::Block as Block>::Header, Vec<<<<Arc<T> as BlockBodyReader<Provider>>::Block as Block>::Body as BlockBody>::Transaction>)>, ) -> Result<Vec<<<Arc<T> as BlockBodyReader<Provider>>::Block as Block>::Body>, ProviderError>

Implementors§

§

impl<Provider> BlockBodyReader<Provider> for EthStorage
where Provider: DBProvider + ChainSpecProvider, <Provider as ChainSpecProvider>::ChainSpec: EthereumHardforks,

§

type Block = Block