mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: make RPC cache generic over primitives (#13146)
This commit is contained in:
@ -40,6 +40,9 @@ impl BlockSource {
|
||||
}
|
||||
}
|
||||
|
||||
/// A helper type alias to access [`BlockReader::Block`].
|
||||
pub type ProviderBlock<P> = <P as BlockReader>::Block;
|
||||
|
||||
/// Api trait for fetching `Block` related data.
|
||||
///
|
||||
/// If not requested otherwise, implementers of this trait should prioritize fetching blocks from
|
||||
|
||||
@ -1,14 +1,18 @@
|
||||
use crate::BlockIdReader;
|
||||
use alloy_eips::{BlockHashOrNumber, BlockId, BlockNumberOrTag};
|
||||
use alloy_primitives::{TxHash, TxNumber};
|
||||
use reth_primitives_traits::Receipt;
|
||||
use reth_storage_errors::provider::ProviderResult;
|
||||
use std::ops::RangeBounds;
|
||||
|
||||
/// A helper type alias to access [`ReceiptProvider::Receipt`].
|
||||
pub type ProviderReceipt<P> = <P as ReceiptProvider>::Receipt;
|
||||
|
||||
/// Client trait for fetching receipt data.
|
||||
#[auto_impl::auto_impl(&, Arc)]
|
||||
pub trait ReceiptProvider: Send + Sync {
|
||||
/// The receipt type.
|
||||
type Receipt: Send + Sync;
|
||||
type Receipt: Receipt;
|
||||
|
||||
/// Get receipt by transaction number
|
||||
///
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
use crate::{BlockNumReader, BlockReader, ReceiptProvider};
|
||||
use crate::{BlockNumReader, BlockReader};
|
||||
use alloy_eips::BlockHashOrNumber;
|
||||
use alloy_primitives::{Address, BlockNumber, TxHash, TxNumber};
|
||||
use reth_primitives::TransactionMeta;
|
||||
@ -84,9 +84,6 @@ pub trait TransactionsProvider: BlockNumReader + Send + Sync {
|
||||
/// A helper type alias to access [`TransactionsProvider::Transaction`].
|
||||
pub type ProviderTx<P> = <P as TransactionsProvider>::Transaction;
|
||||
|
||||
/// A helper type alias to access [`ReceiptProvider::Receipt`].
|
||||
pub type ProviderReceipt<P> = <P as ReceiptProvider>::Receipt;
|
||||
|
||||
/// Client trait for fetching additional transactions related data.
|
||||
#[auto_impl::auto_impl(&, Arc)]
|
||||
pub trait TransactionsProviderExt: BlockReader + Send + Sync {
|
||||
|
||||
Reference in New Issue
Block a user