feat(sdk): introduce PrimitivesTy helper type (#13933)

This commit is contained in:
Dan Cline
2025-01-22 17:29:33 -05:00
committed by GitHub
parent 05b4205243
commit a3015c8a3a
12 changed files with 39 additions and 42 deletions

View File

@ -1,6 +1,6 @@
use crate::{ExExContextDyn, ExExEvent, ExExNotifications, ExExNotificationsStream};
use reth_exex_types::ExExHead;
use reth_node_api::{FullNodeComponents, NodePrimitives, NodeTypes};
use reth_node_api::{FullNodeComponents, NodePrimitives, NodeTypes, PrimitivesTy};
use reth_node_core::node_config::NodeConfig;
use reth_primitives::Head;
use reth_provider::BlockReader;
@ -62,7 +62,7 @@ where
Node::Types: NodeTypes<Primitives: NodePrimitives>,
{
/// Returns dynamic version of the context
pub fn into_dyn(self) -> ExExContextDyn<<Node::Types as NodeTypes>::Primitives> {
pub fn into_dyn(self) -> ExExContextDyn<PrimitivesTy<Node::Types>> {
ExExContextDyn::from(self)
}
}

View File

@ -4,7 +4,7 @@
use std::fmt::Debug;
use reth_chainspec::{EthChainSpec, Head};
use reth_node_api::{FullNodeComponents, HeaderTy, NodePrimitives, NodeTypes};
use reth_node_api::{FullNodeComponents, HeaderTy, NodePrimitives, NodeTypes, PrimitivesTy};
use reth_node_core::node_config::NodeConfig;
use reth_primitives::EthPrimitives;
use reth_provider::BlockReader;
@ -50,7 +50,7 @@ impl<N: NodePrimitives> Debug for ExExContextDyn<N> {
}
}
impl<Node> From<ExExContext<Node>> for ExExContextDyn<<Node::Types as NodeTypes>::Primitives>
impl<Node> From<ExExContext<Node>> for ExExContextDyn<PrimitivesTy<Node::Types>>
where
Node: FullNodeComponents<Types: NodeTypes<Primitives: NodePrimitives>>,
Node::Provider: Debug + BlockReader,