chore: rename default chainspec parser (#11398)

This commit is contained in:
Matthias Seitz
2024-10-02 00:22:57 +02:00
committed by GitHub
parent 7e4b1bff7a
commit 07dc861a94
13 changed files with 36 additions and 34 deletions

View File

@ -16,7 +16,7 @@ use reth_cli_commands::{
use reth_cli_runner::CliRunner;
use reth_db::DatabaseEnv;
use reth_node_builder::{NodeBuilder, WithLaunchContext};
use reth_node_core::args::utils::DefaultChainSpecParser;
use reth_node_core::args::utils::EthereumChainSpecParser;
use reth_node_ethereum::{EthExecutorProvider, EthereumNode};
use reth_tracing::FileWorkerGuard;
use std::{ffi::OsString, fmt, future::Future, sync::Arc};
@ -34,7 +34,8 @@ pub use crate::core::cli::*;
/// This is the entrypoint to the executable.
#[derive(Debug, Parser)]
#[command(author, version = SHORT_VERSION, long_version = LONG_VERSION, about = "Reth", long_about = None)]
pub struct Cli<C: ChainSpecParser = DefaultChainSpecParser, Ext: clap::Args + fmt::Debug = NoArgs> {
pub struct Cli<C: ChainSpecParser = EthereumChainSpecParser, Ext: clap::Args + fmt::Debug = NoArgs>
{
/// The command to run
#[command(subcommand)]
command: Commands<C, Ext>,
@ -116,14 +117,14 @@ impl<C: ChainSpecParser<ChainSpec = ChainSpec>, Ext: clap::Args + fmt::Debug> Cl
///
/// ```no_run
/// use clap::Parser;
/// use reth::{args::utils::DefaultChainSpecParser, cli::Cli};
/// use reth::{args::utils::EthereumChainSpecParser, cli::Cli};
///
/// #[derive(Debug, Parser)]
/// pub struct MyArgs {
/// pub enable: bool,
/// }
///
/// Cli::<DefaultChainSpecParser, MyArgs>::parse()
/// Cli::<EthereumChainSpecParser, MyArgs>::parse()
/// .run(|builder, my_args: MyArgs| async move {
/// // launch the node
///
@ -250,7 +251,7 @@ mod tests {
/// runtime
#[test]
fn test_parse_help_all_subcommands() {
let reth = Cli::<DefaultChainSpecParser, NoArgs>::command();
let reth = Cli::<EthereumChainSpecParser, NoArgs>::command();
for sub_command in reth.get_subcommands() {
let err = Cli::try_parse_args_from(["reth", sub_command.get_name(), "--help"])
.err()

View File

@ -4,7 +4,7 @@
static ALLOC: reth_cli_util::allocator::Allocator = reth_cli_util::allocator::new_allocator();
use clap::{Args, Parser};
use reth::{args::utils::DefaultChainSpecParser, cli::Cli};
use reth::{args::utils::EthereumChainSpecParser, cli::Cli};
use reth_node_builder::{
engine_tree_config::{
TreeConfig, DEFAULT_MEMORY_BLOCK_BUFFER_TARGET, DEFAULT_PERSISTENCE_THRESHOLD,
@ -50,7 +50,7 @@ fn main() {
}
if let Err(err) =
Cli::<DefaultChainSpecParser, EngineArgs>::parse().run(|builder, engine_args| async move {
Cli::<EthereumChainSpecParser, EngineArgs>::parse().run(|builder, engine_args| async move {
let enable_engine2 = engine_args.experimental;
match enable_engine2 {
true => {