mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore(sdk): auto trait bounds NodePrimitives (#12398)
This commit is contained in:
@ -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 {
|
||||
|
||||
@ -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 () {
|
||||
|
||||
@ -41,7 +41,7 @@ use crate::{
|
||||
};
|
||||
|
||||
/// Optimism primitive types.
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Default, Clone)]
|
||||
pub struct OpPrimitives;
|
||||
|
||||
impl NodePrimitives for OpPrimitives {
|
||||
|
||||
Reference in New Issue
Block a user