mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: add Transaction AT to TransactionsProvider (#12794)
This commit is contained in:
@ -23,10 +23,10 @@ use reth_chainspec::{ChainInfo, EthereumHardforks};
|
||||
use reth_db::table::Value;
|
||||
use reth_db_api::models::{AccountBeforeTx, StoredBlockBodyIndices};
|
||||
use reth_evm::ConfigureEvmEnv;
|
||||
use reth_node_types::{FullNodePrimitives, NodeTypes, NodeTypesWithDB};
|
||||
use reth_node_types::{FullNodePrimitives, NodeTypes, NodeTypesWithDB, TxTy};
|
||||
use reth_primitives::{
|
||||
Account, Block, BlockWithSenders, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader,
|
||||
TransactionMeta, TransactionSigned, TransactionSignedNoHash,
|
||||
TransactionMeta, TransactionSigned,
|
||||
};
|
||||
use reth_prune_types::{PruneCheckpoint, PruneSegment};
|
||||
use reth_stages_types::{StageCheckpoint, StageId};
|
||||
@ -76,7 +76,9 @@ where
|
||||
Self: NodeTypes<
|
||||
ChainSpec: EthereumHardforks,
|
||||
Storage: ChainStorage<Self::Primitives>,
|
||||
Primitives: FullNodePrimitives<SignedTx: Value>,
|
||||
Primitives: FullNodePrimitives<
|
||||
SignedTx: Value + From<TransactionSigned> + Into<TransactionSigned>,
|
||||
>,
|
||||
>,
|
||||
{
|
||||
}
|
||||
@ -85,7 +87,9 @@ impl<T> NodeTypesForProvider for T where
|
||||
T: NodeTypes<
|
||||
ChainSpec: EthereumHardforks,
|
||||
Storage: ChainStorage<T::Primitives>,
|
||||
Primitives: FullNodePrimitives<SignedTx: Value>,
|
||||
Primitives: FullNodePrimitives<
|
||||
SignedTx: Value + From<TransactionSigned> + Into<TransactionSigned>,
|
||||
>,
|
||||
>
|
||||
{
|
||||
}
|
||||
@ -417,29 +421,31 @@ impl<N: ProviderNodeTypes> BlockReader for BlockchainProvider<N> {
|
||||
}
|
||||
|
||||
impl<N: ProviderNodeTypes> TransactionsProvider for BlockchainProvider<N> {
|
||||
type Transaction = TxTy<N>;
|
||||
|
||||
fn transaction_id(&self, tx_hash: TxHash) -> ProviderResult<Option<TxNumber>> {
|
||||
self.database.transaction_id(tx_hash)
|
||||
}
|
||||
|
||||
fn transaction_by_id(&self, id: TxNumber) -> ProviderResult<Option<TransactionSigned>> {
|
||||
fn transaction_by_id(&self, id: TxNumber) -> ProviderResult<Option<Self::Transaction>> {
|
||||
self.database.transaction_by_id(id)
|
||||
}
|
||||
|
||||
fn transaction_by_id_unhashed(
|
||||
&self,
|
||||
id: TxNumber,
|
||||
) -> ProviderResult<Option<TransactionSignedNoHash>> {
|
||||
) -> ProviderResult<Option<Self::Transaction>> {
|
||||
self.database.transaction_by_id_unhashed(id)
|
||||
}
|
||||
|
||||
fn transaction_by_hash(&self, hash: TxHash) -> ProviderResult<Option<TransactionSigned>> {
|
||||
fn transaction_by_hash(&self, hash: TxHash) -> ProviderResult<Option<Self::Transaction>> {
|
||||
self.database.transaction_by_hash(hash)
|
||||
}
|
||||
|
||||
fn transaction_by_hash_with_meta(
|
||||
&self,
|
||||
tx_hash: TxHash,
|
||||
) -> ProviderResult<Option<(TransactionSigned, TransactionMeta)>> {
|
||||
) -> ProviderResult<Option<(Self::Transaction, TransactionMeta)>> {
|
||||
self.database.transaction_by_hash_with_meta(tx_hash)
|
||||
}
|
||||
|
||||
@ -450,21 +456,21 @@ impl<N: ProviderNodeTypes> TransactionsProvider for BlockchainProvider<N> {
|
||||
fn transactions_by_block(
|
||||
&self,
|
||||
id: BlockHashOrNumber,
|
||||
) -> ProviderResult<Option<Vec<TransactionSigned>>> {
|
||||
) -> ProviderResult<Option<Vec<Self::Transaction>>> {
|
||||
self.database.transactions_by_block(id)
|
||||
}
|
||||
|
||||
fn transactions_by_block_range(
|
||||
&self,
|
||||
range: impl RangeBounds<BlockNumber>,
|
||||
) -> ProviderResult<Vec<Vec<TransactionSigned>>> {
|
||||
) -> ProviderResult<Vec<Vec<Self::Transaction>>> {
|
||||
self.database.transactions_by_block_range(range)
|
||||
}
|
||||
|
||||
fn transactions_by_tx_range(
|
||||
&self,
|
||||
range: impl RangeBounds<TxNumber>,
|
||||
) -> ProviderResult<Vec<TransactionSignedNoHash>> {
|
||||
) -> ProviderResult<Vec<Self::Transaction>> {
|
||||
self.database.transactions_by_tx_range(range)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user