mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: add BlockBodyIndicesProvider trait (#13347)
This commit is contained in:
@ -60,8 +60,8 @@ use reth_primitives_traits::{Block as _, BlockBody as _, SignedTransaction};
|
||||
use reth_prune_types::{PruneCheckpoint, PruneModes, PruneSegment};
|
||||
use reth_stages_types::{StageCheckpoint, StageId};
|
||||
use reth_storage_api::{
|
||||
BlockBodyReader, NodePrimitivesProvider, OmmersProvider, StateProvider, StorageChangeSetReader,
|
||||
TryIntoHistoricalStateProvider,
|
||||
BlockBodyIndicesProvider, BlockBodyReader, NodePrimitivesProvider, OmmersProvider,
|
||||
StateProvider, StorageChangeSetReader, TryIntoHistoricalStateProvider,
|
||||
};
|
||||
use reth_storage_errors::provider::{ProviderResult, RootMismatch};
|
||||
use reth_trie::{
|
||||
@ -1222,10 +1222,6 @@ impl<TX: DbTx + 'static, N: NodeTypesForProvider> BlockReader for DatabaseProvid
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
fn block_body_indices(&self, num: u64) -> ProviderResult<Option<StoredBlockBodyIndices>> {
|
||||
Ok(self.tx.get::<tables::BlockBodyIndices>(num)?)
|
||||
}
|
||||
|
||||
/// Returns the block with senders with matching number or hash from database.
|
||||
///
|
||||
/// **NOTE: The transactions have invalid hashes, since they would need to be calculated on the
|
||||
@ -1637,6 +1633,14 @@ impl<TX: DbTx + 'static, N: NodeTypesForProvider> OmmersProvider for DatabasePro
|
||||
}
|
||||
}
|
||||
|
||||
impl<TX: DbTx + 'static, N: NodeTypesForProvider> BlockBodyIndicesProvider
|
||||
for DatabaseProvider<TX, N>
|
||||
{
|
||||
fn block_body_indices(&self, num: u64) -> ProviderResult<Option<StoredBlockBodyIndices>> {
|
||||
Ok(self.tx.get::<tables::BlockBodyIndices>(num)?)
|
||||
}
|
||||
}
|
||||
|
||||
impl<TX: DbTx + 'static, N: NodeTypesForProvider> EvmEnvProvider<HeaderTy<N>>
|
||||
for DatabaseProvider<TX, N>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user