Skip to content

Commit

Permalink
make rpc params optional
Browse files Browse the repository at this point in the history
  • Loading branch information
breathx committed Dec 2, 2024
1 parent 1016e24 commit c15da3d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ethexe/cli/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ pub struct Args {

#[allow(missing_docs)]
#[clap(flatten)]
pub rpc_params: RpcParams,
pub rpc_params: Option<RpcParams>,

#[command(subcommand)]
pub extra_command: Option<ExtraCommands>,
Expand Down
2 changes: 1 addition & 1 deletion ethexe/cli/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ impl TryFrom<Args> 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()),
})
}
}
1 change: 1 addition & 0 deletions ethexe/cli/src/params/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ impl RpcParams {
///
/// The type is introduced to overcome `Option<Option<T>>` handling of `clap`.
#[derive(Clone, Debug, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum Cors {
/// All hosts allowed.
All,
Expand Down

0 comments on commit c15da3d

Please sign in to comment.