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};
|
use crate::{EthEngineTypes, EthEvmConfig};
|
||||||
|
|
||||||
/// Ethereum primitive types.
|
/// Ethereum primitive types.
|
||||||
#[derive(Debug)]
|
#[derive(Debug, Default, Clone)]
|
||||||
pub struct EthPrimitives;
|
pub struct EthPrimitives;
|
||||||
|
|
||||||
impl NodePrimitives for EthPrimitives {
|
impl NodePrimitives for EthPrimitives {
|
||||||
|
|||||||
@ -8,24 +8,27 @@
|
|||||||
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
|
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
|
||||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
#![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_chainspec::EthChainSpec;
|
||||||
use reth_db_api::{
|
use reth_db_api::{
|
||||||
database_metrics::{DatabaseMetadata, DatabaseMetrics},
|
database_metrics::{DatabaseMetadata, DatabaseMetrics},
|
||||||
Database,
|
Database,
|
||||||
};
|
};
|
||||||
use reth_engine_primitives::EngineTypes;
|
use reth_engine_primitives::EngineTypes;
|
||||||
pub use reth_primitives_traits::{Block, BlockBody};
|
|
||||||
use reth_trie_db::StateCommitment;
|
use reth_trie_db::StateCommitment;
|
||||||
use std::marker::PhantomData;
|
|
||||||
|
|
||||||
/// Configures all the primitive types of the node.
|
/// Configures all the primitive types of the node.
|
||||||
pub trait NodePrimitives {
|
pub trait NodePrimitives: Send + Sync + Unpin + Clone + Default + fmt::Debug {
|
||||||
/// Block primitive.
|
/// Block primitive.
|
||||||
type Block;
|
type Block: Send + Sync + Unpin + Clone + Default + fmt::Debug + 'static;
|
||||||
/// Signed version of the transaction type.
|
/// Signed version of the transaction type.
|
||||||
type SignedTx;
|
type SignedTx: Send + Sync + Unpin + Clone + Default + fmt::Debug + 'static;
|
||||||
/// A receipt.
|
/// A receipt.
|
||||||
type Receipt;
|
type Receipt: Send + Sync + Unpin + Clone + Default + fmt::Debug + 'static;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl NodePrimitives for () {
|
impl NodePrimitives for () {
|
||||||
|
|||||||
@ -41,7 +41,7 @@ use crate::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
/// Optimism primitive types.
|
/// Optimism primitive types.
|
||||||
#[derive(Debug)]
|
#[derive(Debug, Default, Clone)]
|
||||||
pub struct OpPrimitives;
|
pub struct OpPrimitives;
|
||||||
|
|
||||||
impl NodePrimitives for OpPrimitives {
|
impl NodePrimitives for OpPrimitives {
|
||||||
|
|||||||
Reference in New Issue
Block a user