Skip to content

Commit

Permalink
chore: add with ext function (#4087)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Aug 6, 2023
1 parent c423514 commit aaf2d2c
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions bin/reth/src/node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,40 @@ pub struct NodeCommand<Ext: RethCliExt = ()> {
}

impl<Ext: RethCliExt> NodeCommand<Ext> {
/// Replaces the extension of the node command
pub fn with_ext<E: RethCliExt>(self, ext: E::Node) -> NodeCommand<E> {
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);
Expand Down

0 comments on commit aaf2d2c

Please sign in to comment.