From 64bd4c9cd4a21fb7b409296af70e2d9bb6dc05be Mon Sep 17 00:00:00 2001 From: samkim-crypto Date: Fri, 22 Nov 2024 11:34:07 +0900 Subject: [PATCH] only parse default keypair source when necessary --- token/cli/src/config.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/token/cli/src/config.rs b/token/cli/src/config.rs index 72be7f30495..adc405c97e6 100644 --- a/token/cli/src/config.rs +++ b/token/cli/src/config.rs @@ -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> = { if let Some(source) = matches.try_get_one::("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,