From cb57baaa36782a0910e9bd030d972a1f741ec24a Mon Sep 17 00:00:00 2001 From: Pravdyvy Date: Thu, 5 Mar 2026 14:13:13 +0200 Subject: [PATCH] fix: integartion test on claiming path for token updated --- integration_tests/tests/token.rs | 15 +++++++++++++++ wallet/src/lib.rs | 6 ++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/integration_tests/tests/token.rs b/integration_tests/tests/token.rs index 0ff6eee5..bcd63556 100644 --- a/integration_tests/tests/token.rs +++ b/integration_tests/tests/token.rs @@ -1087,6 +1087,21 @@ async fn token_claiming_path_with_private_accounts() -> Result<()> { info!("Waiting for next block creation"); tokio::time::sleep(Duration::from_secs(TIME_TO_WAIT_FOR_BLOCK_SECONDS)).await; + // Key Tree shift + // This way we have account with child index > 0. + // Shared secret derivation dependant of child index, so this way we can test it as well. + let result = wallet::cli::execute_subcommand( + ctx.wallet_mut(), + Command::Account(AccountSubcommand::New(NewSubcommand::Private { + cci: None, + label: None, + })), + ) + .await?; + let SubcommandReturnValue::RegisterAccount { account_id: _ } = result else { + anyhow::bail!("Expected RegisterAccount return value"); + }; + // Create new private account for claiming path let result = wallet::cli::execute_subcommand( ctx.wallet_mut(), diff --git a/wallet/src/lib.rs b/wallet/src/lib.rs index f3755b0b..486133d8 100644 --- a/wallet/src/lib.rs +++ b/wallet/src/lib.rs @@ -461,14 +461,12 @@ impl WalletCore { let shared_secret = key_chain .calculate_shared_secret_receiver(encrypted_data.epk.clone(), index); - let res = nssa_core::EncryptionScheme::decrypt( + nssa_core::EncryptionScheme::decrypt( ciphertext, &shared_secret, commitment, ciph_id as u32, - ); - - res + ) }) .map(move |res_acc| (acc_account_id, res_acc)) .collect::>()