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 64bd4c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions token/cli/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,13 @@ impl<'a> Config<'a> {
};

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 {
let default_keypair_source =
SignerSource::parse(&default_keypair).unwrap_or_else(print_error_and_exit);
signer_from_source_with_config(
matches,
&default_keypair_source,
Expand Down

0 comments on commit 64bd4c9

Please sign in to comment.