mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: add ConfigureEvmFor, ConfigureEvmEnvFor helper traits (#13865)
This commit is contained in:
@ -7,8 +7,9 @@ use std::{
|
||||
sync::Arc,
|
||||
};
|
||||
|
||||
use reth_evm::{ConfigureEvm, ConfigureEvmEnv};
|
||||
use reth_network::NetworkPrimitives;
|
||||
use reth_node_api::{BlockBody, EngineTypes, FullNodeComponents};
|
||||
use reth_node_api::{BlockBody, EngineTypes, FullNodeComponents, NodePrimitives};
|
||||
use reth_node_core::{
|
||||
dirs::{ChainPath, DataDirPath},
|
||||
node_config::NodeConfig,
|
||||
@ -235,3 +236,31 @@ where
|
||||
>,
|
||||
{
|
||||
}
|
||||
|
||||
/// This is a type alias to make type bounds simpler when we have a [`NodePrimitives`] and need a
|
||||
/// [`ConfigureEvmEnv`] whose associated types match the [`NodePrimitives`] associated types.
|
||||
pub trait ConfigureEvmEnvFor<N: NodePrimitives>:
|
||||
ConfigureEvmEnv<Header = N::BlockHeader, Transaction = N::SignedTx>
|
||||
{
|
||||
}
|
||||
|
||||
impl<N, C> ConfigureEvmEnvFor<N> for C
|
||||
where
|
||||
N: NodePrimitives,
|
||||
C: ConfigureEvmEnv<Header = N::BlockHeader, Transaction = N::SignedTx>,
|
||||
{
|
||||
}
|
||||
|
||||
/// This is a type alias to make type bounds simpler when we have a [`NodePrimitives`] and need a
|
||||
/// [`ConfigureEvm`] whose associated types match the [`NodePrimitives`] associated types.
|
||||
pub trait ConfigureEvmFor<N: NodePrimitives>:
|
||||
ConfigureEvm<Header = N::BlockHeader, Transaction = N::SignedTx>
|
||||
{
|
||||
}
|
||||
|
||||
impl<N, C> ConfigureEvmFor<N> for C
|
||||
where
|
||||
N: NodePrimitives,
|
||||
C: ConfigureEvm<Header = N::BlockHeader, Transaction = N::SignedTx>,
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user