reth_storage_api/
block_hash.rsuse alloy_eips::BlockHashOrNumber;
use alloy_primitives::{BlockNumber, B256};
use reth_storage_errors::provider::ProviderResult;
#[auto_impl::auto_impl(&, Arc, Box)]
pub trait BlockHashReader: Send + Sync {
fn block_hash(&self, number: BlockNumber) -> ProviderResult<Option<B256>>;
fn convert_block_hash(
&self,
hash_or_number: BlockHashOrNumber,
) -> ProviderResult<Option<B256>> {
match hash_or_number {
BlockHashOrNumber::Hash(hash) => Ok(Some(hash)),
BlockHashOrNumber::Number(num) => self.block_hash(num),
}
}
fn canonical_hashes_range(
&self,
start: BlockNumber,
end: BlockNumber,
) -> ProviderResult<Vec<B256>>;
}