reth/commands/debug_cmd/
mod.rsuse clap::{Parser, Subcommand};
use reth_chainspec::ChainSpec;
use reth_cli::chainspec::ChainSpecParser;
use reth_cli_runner::CliContext;
use reth_node_api::NodeTypesWithEngine;
use reth_node_ethereum::EthEngineTypes;
mod build_block;
mod execution;
mod in_memory_merkle;
mod merkle;
mod replay_engine;
#[derive(Debug, Parser)]
pub struct Command<C: ChainSpecParser> {
#[command(subcommand)]
command: Subcommands<C>,
}
#[derive(Subcommand, Debug)]
pub enum Subcommands<C: ChainSpecParser> {
Execution(execution::Command<C>),
Merkle(merkle::Command<C>),
InMemoryMerkle(in_memory_merkle::Command<C>),
BuildBlock(build_block::Command<C>),
ReplayEngine(replay_engine::Command<C>),
}
impl<C: ChainSpecParser<ChainSpec = ChainSpec>> Command<C> {
pub async fn execute<
N: NodeTypesWithEngine<Engine = EthEngineTypes, ChainSpec = C::ChainSpec>,
>(
self,
ctx: CliContext,
) -> eyre::Result<()> {
match self.command {
Subcommands::Execution(command) => command.execute::<N>(ctx).await,
Subcommands::Merkle(command) => command.execute::<N>(ctx).await,
Subcommands::InMemoryMerkle(command) => command.execute::<N>(ctx).await,
Subcommands::BuildBlock(command) => command.execute::<N>(ctx).await,
Subcommands::ReplayEngine(command) => command.execute::<N>(ctx).await,
}
}
}