storage-api: update BlockReaderIdExt (#11110)

This commit is contained in:
nk_ysg
2024-09-23 17:47:15 +08:00
committed by GitHub
parent d21d070605
commit bb27f37cc7
3 changed files with 5 additions and 5 deletions

View File

@ -1229,7 +1229,7 @@ where
impl<N: NodeTypesWithDB> BlockReaderIdExt for BlockchainProvider2<N> impl<N: NodeTypesWithDB> BlockReaderIdExt for BlockchainProvider2<N>
where where
Self: BlockReader + BlockIdReader + ReceiptProviderIdExt, Self: BlockReader + ReceiptProviderIdExt,
{ {
fn block_by_id(&self, id: BlockId) -> ProviderResult<Option<Block>> { fn block_by_id(&self, id: BlockId) -> ProviderResult<Option<Block>> {
match id { match id {

View File

@ -798,7 +798,7 @@ where
impl<N: ProviderNodeTypes> BlockReaderIdExt for BlockchainProvider<N> impl<N: ProviderNodeTypes> BlockReaderIdExt for BlockchainProvider<N>
where where
Self: BlockReader + BlockIdReader + ReceiptProviderIdExt, Self: BlockReader + ReceiptProviderIdExt,
{ {
fn block_by_id(&self, id: BlockId) -> ProviderResult<Option<Block>> { fn block_by_id(&self, id: BlockId) -> ProviderResult<Option<Block>> {
match id { match id {

View File

@ -1,6 +1,6 @@
use crate::{ use crate::{
BlockIdReader, BlockNumReader, HeaderProvider, ReceiptProvider, ReceiptProviderIdExt, BlockNumReader, HeaderProvider, ReceiptProvider, ReceiptProviderIdExt, RequestsProvider,
RequestsProvider, TransactionVariant, TransactionsProvider, WithdrawalsProvider, TransactionVariant, TransactionsProvider, WithdrawalsProvider,
}; };
use alloy_eips::{BlockHashOrNumber, BlockId, BlockNumberOrTag}; use alloy_eips::{BlockHashOrNumber, BlockId, BlockNumberOrTag};
use alloy_primitives::{BlockNumber, B256}; use alloy_primitives::{BlockNumber, B256};
@ -161,7 +161,7 @@ pub trait BlockReader:
/// `BlockIdReader` methods should be used to resolve `BlockId`s to block numbers or hashes, and /// `BlockIdReader` methods should be used to resolve `BlockId`s to block numbers or hashes, and
/// retrieving the block should be done using the type's `BlockReader` methods. /// retrieving the block should be done using the type's `BlockReader` methods.
#[auto_impl::auto_impl(&, Arc)] #[auto_impl::auto_impl(&, Arc)]
pub trait BlockReaderIdExt: BlockReader + BlockIdReader + ReceiptProviderIdExt { pub trait BlockReaderIdExt: BlockReader + ReceiptProviderIdExt {
/// Returns the block with matching tag from the database /// Returns the block with matching tag from the database
/// ///
/// Returns `None` if block is not found. /// Returns `None` if block is not found.