From 057d0b88c5bb0542cf5cdf23399ff5665981a3d8 Mon Sep 17 00:00:00 2001 From: Vlad Frolov Date: Wed, 21 Aug 2024 18:53:48 +0200 Subject: [PATCH] fix: Fixed the fallback legacy keychain path (#398) --- .../sign_with_legacy_keychain/mod.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/transaction_signature_options/sign_with_legacy_keychain/mod.rs b/src/transaction_signature_options/sign_with_legacy_keychain/mod.rs index e2485b8d..2e9dd7ff 100644 --- a/src/transaction_signature_options/sign_with_legacy_keychain/mod.rs +++ b/src/transaction_signature_options/sign_with_legacy_keychain/mod.rs @@ -55,12 +55,13 @@ impl SignLegacyKeychainContext { ) -> color_eyre::eyre::Result { let network_config = previous_context.network_config.clone(); - let signer_keychain_folder = previous_context + let keychain_folder = previous_context .global_context .config .credentials_home_dir - .join(&network_config.network_name) - .join(previous_context.prepopulated_transaction.signer_id.as_str()); + .join(&network_config.network_name); + let signer_keychain_folder = + keychain_folder.join(previous_context.prepopulated_transaction.signer_id.as_str()); let signer_access_key_file_path: std::path::PathBuf = { if previous_context.global_context.offline { signer_keychain_folder.join(format!( @@ -113,12 +114,12 @@ impl SignLegacyKeychainContext { .filter_map(Result::ok) .find(|entry| full_access_key_filenames.contains(&entry.file_name())) .map(|signer_access_key| signer_access_key.path()) - .unwrap_or_else(|| signer_keychain_folder.join(format!( + .unwrap_or_else(|| keychain_folder.join(format!( "{}.json", previous_context.prepopulated_transaction.signer_id ))) } else { - signer_keychain_folder.join(format!( + keychain_folder.join(format!( "{}.json", previous_context.prepopulated_transaction.signer_id ))