Skip to content

Commit

Permalink
only parse default keypair source when necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
samkim-crypto committed Nov 22, 2024
1 parent 92d4006 commit ae6082d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions token/cli/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,17 +186,15 @@ impl<'a> Config<'a> {
allow_null_signer: !multisigner_pubkeys.is_empty(),
};

let default_keypair = cli_config.keypair_path.clone();
let default_keypair_source =
SignerSource::parse(&default_keypair).unwrap_or_else(print_error_and_exit);
let default_signer: Option<Arc<dyn Signer>> = {
if let Some(source) = matches.try_get_one::<SignerSource>("owner").ok().flatten() {
signer_from_source_with_config(matches, source, "owner", wallet_manager, &config)
.ok()
} else {
signer_from_source_with_config(
let default_keypair = cli_config.keypair_path.clone();
signer_from_path_with_config(
matches,
&default_keypair_source,
&default_keypair,
"default",
wallet_manager,
&config,
Expand Down

0 comments on commit ae6082d

Please sign in to comment.