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
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>
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.