From c15da3dc95de05bcea7ff3472107e0cefa7bcf6a Mon Sep 17 00:00:00 2001 From: Dmitrii Novikov Date: Mon, 2 Dec 2024 21:30:46 +0400 Subject: [PATCH] make rpc params optional --- ethexe/cli/src/args.rs | 2 +- ethexe/cli/src/config.rs | 2 +- ethexe/cli/src/params/rpc.rs | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ethexe/cli/src/args.rs b/ethexe/cli/src/args.rs index 8ec865259e9..0dc0e8be807 100644 --- a/ethexe/cli/src/args.rs +++ b/ethexe/cli/src/args.rs @@ -117,7 +117,7 @@ pub struct Args { #[allow(missing_docs)] #[clap(flatten)] - pub rpc_params: RpcParams, + pub rpc_params: Option, #[command(subcommand)] pub extra_command: Option, diff --git a/ethexe/cli/src/config.rs b/ethexe/cli/src/config.rs index daf0a4ad456..031723fc0fd 100644 --- a/ethexe/cli/src/config.rs +++ b/ethexe/cli/src/config.rs @@ -215,7 +215,7 @@ impl TryFrom for Config { prometheus_config: args.prometheus_params.and_then(|params| { params.prometheus_config(DEFAULT_PROMETHEUS_PORT, "ethexe-dev".to_string()) }), - rpc_config: args.rpc_params.as_config(), + rpc_config: args.rpc_params.and_then(|v| v.as_config()), }) } } diff --git a/ethexe/cli/src/params/rpc.rs b/ethexe/cli/src/params/rpc.rs index e75758aec85..675ecd0e17b 100644 --- a/ethexe/cli/src/params/rpc.rs +++ b/ethexe/cli/src/params/rpc.rs @@ -85,6 +85,7 @@ impl RpcParams { /// /// The type is introduced to overcome `Option>` handling of `clap`. #[derive(Clone, Debug, Deserialize)] +#[serde(rename_all = "lowercase")] pub enum Cors { /// All hosts allowed. All,