Skip to content

Commit

Permalink
add backward compatibility for AccountProviderConfig (#3633)
Browse files Browse the repository at this point in the history
* add backward compatibility for AccountProviderConfig

add serde default for AccountProviderConfig's field named from_env

* add skip_serializing_if to secret_file

add skip_serializing_if to secret_file
  • Loading branch information
JerryKwan authored Aug 10, 2022
1 parent 5e71b00 commit 3bba812
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config/src/account_provider_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pub struct AccountProviderConfig {
pub account_dir: Option<PathBuf>,

/// Path to the secret file storing the private key.
#[serde(skip_serializing_if = "Option::is_none")]
#[clap(
long = "secret-file",
help = "file path of private key",
Expand All @@ -25,6 +26,7 @@ pub struct AccountProviderConfig {
pub secret_file: Option<PathBuf>,

/// Read private from env variable `STARCOIN_PRIVATE_KEY`.
#[serde(default)]
#[clap(long = "from-env")]
pub from_env: bool,

Expand Down

0 comments on commit 3bba812

Please sign in to comment.