chore(sdk): enable referencing network type via FullNodeComponents::Network (#9921)

This commit is contained in:
Emilia Hane
2024-08-01 19:50:20 +02:00
committed by GitHub
parent 1a74d1407a
commit c71c813032
20 changed files with 66 additions and 53 deletions

View File

@ -17,7 +17,6 @@ reth-config.workspace = true
reth-evm.workspace = true
reth-exex-types.workspace = true
reth-metrics.workspace = true
reth-network.workspace = true
reth-node-api.workspace = true
reth-node-core.workspace = true
reth-payload-builder.workspace = true

View File

@ -1,11 +1,13 @@
use crate::{ExExEvent, ExExNotification};
use std::fmt::Debug;
use reth_node_api::FullNodeComponents;
use reth_node_core::node_config::NodeConfig;
use reth_primitives::Head;
use reth_tasks::TaskExecutor;
use std::fmt::Debug;
use tokio::sync::mpsc::{Receiver, UnboundedSender};
use crate::{ExExEvent, ExExNotification};
/// Captures the context that an `ExEx` has access to.
pub struct ExExContext<Node: FullNodeComponents> {
/// The current head of the blockchain at launch.
@ -69,7 +71,7 @@ impl<Node: FullNodeComponents> ExExContext<Node> {
}
/// Returns the handle to the network
pub fn network(&self) -> &reth_network::NetworkHandle {
pub fn network(&self) -> &Node::Network {
self.components.network()
}