feat: NodePrimitivesProvider (#12855)

This commit is contained in:
Arsenii Kulikov
2024-11-26 16:06:55 +04:00
committed by GitHub
parent b34fb7883a
commit 26fc701814
40 changed files with 239 additions and 148 deletions

View File

@ -14,9 +14,11 @@ use reth_chainspec::{ChainSpec, EthereumHardfork, MIN_TRANSACTION_GAS};
use reth_execution_types::{Chain, ExecutionOutcome};
use reth_primitives::{
proofs::{calculate_receipt_root, calculate_transaction_root, calculate_withdrawals_root},
BlockBody, NodePrimitives, Receipt, Receipts, SealedBlock, SealedBlockWithSenders,
SealedHeader, Transaction, TransactionSigned, TransactionSignedEcRecovered,
BlockBody, EthPrimitives, NodePrimitives, Receipt, Receipts, SealedBlock,
SealedBlockWithSenders, SealedHeader, Transaction, TransactionSigned,
TransactionSignedEcRecovered,
};
use reth_storage_api::NodePrimitivesProvider;
use reth_trie::{root::state_root_unhashed, updates::TrieUpdates, HashedPostState};
use revm::{db::BundleState, primitives::AccountInfo};
use std::{
@ -314,6 +316,10 @@ impl TestCanonStateSubscriptions {
}
}
impl NodePrimitivesProvider for TestCanonStateSubscriptions {
type Primitives = EthPrimitives;
}
impl CanonStateSubscriptions for TestCanonStateSubscriptions {
/// Sets up a broadcast channel with a buffer size of 100.
fn subscribe_to_canonical_state(&self) -> CanonStateNotifications {