From aaf2d2cf194cc5b2c6e8ec106001ee44db9512c9 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Sun, 6 Aug 2023 14:14:26 +0200 Subject: [PATCH] chore: add with ext function (#4087) --- bin/reth/src/node/mod.rs | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/bin/reth/src/node/mod.rs b/bin/reth/src/node/mod.rs index 397fce91f1..65657b71ff 100644 --- a/bin/reth/src/node/mod.rs +++ b/bin/reth/src/node/mod.rs @@ -159,6 +159,40 @@ pub struct NodeCommand { } impl NodeCommand { + /// Replaces the extension of the node command + pub fn with_ext(self, ext: E::Node) -> NodeCommand { + let Self { + datadir, + config, + chain, + metrics, + network, + rpc, + txpool, + builder, + debug, + db, + dev, + pruning, + .. + } = self; + NodeCommand { + datadir, + config, + chain, + metrics, + network, + rpc, + txpool, + builder, + debug, + db, + dev, + pruning, + ext, + } + } + /// Execute `node` command pub async fn execute(mut self, ctx: CliContext) -> eyre::Result<()> { info!(target: "reth::cli", "reth {} starting", SHORT_VERSION);