Trait BlockBodyWriter
pub trait BlockBodyWriter<Provider, Body>where
Body: BlockBody,{
// Required methods
fn write_block_bodies(
&self,
provider: &Provider,
bodies: Vec<(u64, Option<Body>)>,
write_to: StorageLocation,
) -> Result<(), ProviderError>;
fn remove_block_bodies_above(
&self,
provider: &Provider,
block: u64,
remove_from: StorageLocation,
) -> Result<(), ProviderError>;
}
Expand description
Trait that implements how block bodies are written to the storage.
Note: Within the current abstraction, this should only write to tables unrelated to transactions. Writing of transactions is handled separately.
Required Methods§
fn write_block_bodies(
&self,
provider: &Provider,
bodies: Vec<(u64, Option<Body>)>,
write_to: StorageLocation,
) -> Result<(), ProviderError>
fn write_block_bodies( &self, provider: &Provider, bodies: Vec<(u64, Option<Body>)>, write_to: StorageLocation, ) -> Result<(), ProviderError>
Writes a set of block bodies to the storage.
fn remove_block_bodies_above(
&self,
provider: &Provider,
block: u64,
remove_from: StorageLocation,
) -> Result<(), ProviderError>
fn remove_block_bodies_above( &self, provider: &Provider, block: u64, remove_from: StorageLocation, ) -> Result<(), ProviderError>
Removes all block bodies above the given block number from the database.