mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore(sdk): Add NodePrimitives::Transaction and NodePrimitives::SignedTx (#12330)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -8106,7 +8106,6 @@ dependencies = [
|
||||
"reth-chainspec",
|
||||
"reth-db-api",
|
||||
"reth-engine-primitives",
|
||||
"reth-primitives",
|
||||
"reth-primitives-traits",
|
||||
"reth-trie-db",
|
||||
]
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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 = ();
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user