chore(sdk): Add NodePrimitives::Transaction and NodePrimitives::SignedTx (#12330)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Emilia Hane
2024-11-09 10:20:25 +01:00
committed by GitHub
parent 08451ef278
commit 430fe0de18
5 changed files with 10 additions and 9 deletions

1
Cargo.lock generated
View File

@ -8106,7 +8106,6 @@ dependencies = [
"reth-chainspec",
"reth-db-api",
"reth-engine-primitives",
"reth-primitives",
"reth-primitives-traits",
"reth-trie-db",
]

View File

@ -25,7 +25,7 @@ use reth_node_builder::{
BuilderContext, Node, NodeAdapter, NodeComponentsBuilder, PayloadBuilderConfig, PayloadTypes,
};
use reth_payload_builder::{PayloadBuilderHandle, PayloadBuilderService};
use reth_primitives::{Block, Header, Receipt};
use reth_primitives::{Block, Header, Receipt, TransactionSigned};
use reth_provider::CanonStateSubscriptions;
use reth_rpc::EthApi;
use reth_tracing::tracing::{debug, info};
@ -43,6 +43,7 @@ pub struct EthPrimitives;
impl NodePrimitives for EthPrimitives {
type Block = Block;
type SignedTx = TransactionSigned;
type Receipt = Receipt;
}

View File

@ -15,6 +15,5 @@ workspace = true
reth-chainspec.workspace = true
reth-db-api.workspace = true
reth-engine-primitives.workspace = true
reth-primitives.workspace = true
reth-primitives-traits.workspace = true
reth-trie-db.workspace = true

View File

@ -8,28 +8,29 @@
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
pub use reth_primitives_traits::{Block, BlockBody};
use std::marker::PhantomData;
use reth_chainspec::EthChainSpec;
use reth_db_api::{
database_metrics::{DatabaseMetadata, DatabaseMetrics},
Database,
};
use reth_engine_primitives::EngineTypes;
pub use reth_primitives_traits::{Block, BlockBody};
use reth_trie_db::StateCommitment;
use std::marker::PhantomData;
/// Configures all the primitive types of the node.
pub trait NodePrimitives {
/// Block primitive.
type Block;
/// Signed version of the transaction type.
type SignedTx;
/// A receipt.
type Receipt;
}
impl NodePrimitives for () {
type Block = reth_primitives::Block;
type Block = ();
type SignedTx = ();
type Receipt = ();
}

View File

@ -24,7 +24,7 @@ use reth_optimism_evm::{OpEvmConfig, OpExecutionStrategyFactory};
use reth_optimism_payload_builder::builder::OpPayloadTransactions;
use reth_optimism_rpc::OpEthApi;
use reth_payload_builder::{PayloadBuilderHandle, PayloadBuilderService};
use reth_primitives::{Block, Header, Receipt};
use reth_primitives::{Block, Header, Receipt, TransactionSigned};
use reth_provider::CanonStateSubscriptions;
use reth_tracing::tracing::{debug, info};
use reth_transaction_pool::{
@ -46,6 +46,7 @@ pub struct OpPrimitives;
impl NodePrimitives for OpPrimitives {
type Block = Block;
type SignedTx = TransactionSigned;
type Receipt = Receipt;
}