chore: use FnOnce on WithLaunchContext methods (#7989)

This commit is contained in:
Roman Krasiuk
2024-04-30 13:27:56 +02:00
committed by GitHub
parent b3d7b7d501
commit 0f9658cfa1
2 changed files with 8 additions and 6 deletions

View File

@ -316,7 +316,7 @@ where
/// Sets the hook that is run once the node's components are initialized.
pub fn on_component_initialized<F>(self, hook: F) -> Self
where
F: Fn(NodeAdapter<RethFullAdapter<DB, T>, CB::Components>) -> eyre::Result<()>
F: FnOnce(NodeAdapter<RethFullAdapter<DB, T>, CB::Components>) -> eyre::Result<()>
+ Send
+ 'static,
{
@ -330,7 +330,9 @@ where
/// Sets the hook that is run once the node has started.
pub fn on_node_started<F>(self, hook: F) -> Self
where
F: Fn(FullNode<NodeAdapter<RethFullAdapter<DB, T>, CB::Components>>) -> eyre::Result<()>
F: FnOnce(
FullNode<NodeAdapter<RethFullAdapter<DB, T>, CB::Components>>,
) -> eyre::Result<()>
+ Send
+ 'static,
{
@ -344,7 +346,7 @@ where
/// Sets the hook that is run once the rpc server is started.
pub fn on_rpc_started<F>(self, hook: F) -> Self
where
F: Fn(
F: FnOnce(
RpcContext<'_, NodeAdapter<RethFullAdapter<DB, T>, CB::Components>>,
RethRpcServerHandles,
) -> eyre::Result<()>
@ -361,7 +363,7 @@ where
/// Sets the hook that is run to configure the rpc modules.
pub fn extend_rpc_modules<F>(self, hook: F) -> Self
where
F: Fn(
F: FnOnce(
RpcContext<'_, NodeAdapter<RethFullAdapter<DB, T>, CB::Components>>,
) -> eyre::Result<()>
+ Send
@ -381,7 +383,7 @@ where
/// The ExEx ID must be unique.
pub fn install_exex<F, R, E>(self, exex_id: impl Into<String>, exex: F) -> Self
where
F: Fn(ExExContext<NodeAdapter<RethFullAdapter<DB, T>, CB::Components>>) -> R
F: FnOnce(ExExContext<NodeAdapter<RethFullAdapter<DB, T>, CB::Components>>) -> R
+ Send
+ 'static,
R: Future<Output = eyre::Result<E>> + Send,