Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(sdk): auto trait bounds NodePrimitives #12398

Merged
merged 3 commits into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/ethereum/node/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use reth_trie_db::MerklePatriciaTrie;
use crate::{EthEngineTypes, EthEvmConfig};

/// Ethereum primitive types.
#[derive(Debug)]
#[derive(Debug, Default, Clone)]
pub struct EthPrimitives;

impl NodePrimitives for EthPrimitives {
Expand Down
15 changes: 9 additions & 6 deletions crates/node/types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,27 @@
#![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 core::fmt;
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 {
pub trait NodePrimitives: Send + Sync + Unpin + Clone + Default + fmt::Debug {
/// Block primitive.
type Block;
type Block: Send + Sync + Unpin + Clone + Default + fmt::Debug + 'static;
/// Signed version of the transaction type.
type SignedTx;
type SignedTx: Send + Sync + Unpin + Clone + Default + fmt::Debug + 'static;
/// A receipt.
type Receipt;
type Receipt: Send + Sync + Unpin + Clone + Default + fmt::Debug + 'static;
}

impl NodePrimitives for () {
Expand Down
2 changes: 1 addition & 1 deletion crates/optimism/node/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ use crate::{
};

/// Optimism primitive types.
#[derive(Debug)]
#[derive(Debug, Default, Clone)]
pub struct OpPrimitives;

impl NodePrimitives for OpPrimitives {
Expand Down
Loading