From 6f9c3b2af3e8bfc52f3b3dade60675cb9c614d6f Mon Sep 17 00:00:00 2001 From: Sergio Chouhy Date: Fri, 24 Apr 2026 00:37:36 -0300 Subject: [PATCH] fmt --- .../key_management/key_tree/keys_private.rs | 9 +++------ key_protocol/src/key_protocol_core/mod.rs | 5 +++-- wallet/src/chain_storage.rs | 18 ++++++++++++++---- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/key_protocol/src/key_management/key_tree/keys_private.rs b/key_protocol/src/key_management/key_tree/keys_private.rs index 69c47d34..6ffc8119 100644 --- a/key_protocol/src/key_management/key_tree/keys_private.rs +++ b/key_protocol/src/key_management/key_tree/keys_private.rs @@ -115,12 +115,9 @@ impl KeyTreeNode for ChildKeysPrivate { } fn account_ids(&self) -> impl Iterator { - self.value - .1 - .iter() - .map(|(identifier, _)| { - nssa::AccountId::from((&self.value.0.nullifier_public_key, *identifier)) - }) + self.value.1.iter().map(|(identifier, _)| { + nssa::AccountId::from((&self.value.0.nullifier_public_key, *identifier)) + }) } } diff --git a/key_protocol/src/key_protocol_core/mod.rs b/key_protocol/src/key_protocol_core/mod.rs index e189a37d..4df6df82 100644 --- a/key_protocol/src/key_protocol_core/mod.rs +++ b/key_protocol/src/key_protocol_core/mod.rs @@ -17,7 +17,7 @@ pub type PublicKey = AffinePoint; #[derive(Clone, Debug, Serialize, Deserialize)] pub struct UserPrivateAccountData { pub key_chain: KeyChain, - pub accounts: Vec<(Identifier, Account)> + pub accounts: Vec<(Identifier, Account)>, } #[derive(Clone, Debug, Serialize, Deserialize)] @@ -54,7 +54,8 @@ impl NSSAUserData { let mut check_res = true; for (account_id, entry) in accounts_keys_map { let any_match = entry.accounts.iter().any(|(identifier, _)| { - nssa::AccountId::from((&entry.key_chain.nullifier_public_key, *identifier)) == *account_id + nssa::AccountId::from((&entry.key_chain.nullifier_public_key, *identifier)) + == *account_id }); if !any_match { println!("No matching entry found for account_id {account_id}"); diff --git a/wallet/src/chain_storage.rs b/wallet/src/chain_storage.rs index 903c5b3b..60756cd8 100644 --- a/wallet/src/chain_storage.rs +++ b/wallet/src/chain_storage.rs @@ -79,7 +79,11 @@ impl WalletChainStore { InitialAccountData::Private(data) => { private_init_acc_map.insert( data.account_id, - UserPrivateAccountData{ key_chain: data.key_chain, accounts: vec![(data.identifier, data.account)]}); + UserPrivateAccountData { + key_chain: data.key_chain, + accounts: vec![(data.identifier, data.account)], + }, + ); } }, } @@ -120,7 +124,11 @@ impl WalletChainStore { account.program_owner = Program::authenticated_transfer_program().id(); private_init_acc_map.insert( data.account_id, - UserPrivateAccountData{key_chain: data.key_chain, accounts:vec![(data.identifier, account)]}); + UserPrivateAccountData { + key_chain: data.key_chain, + accounts: vec![(data.identifier, account)], + }, + ); } } } @@ -185,10 +193,12 @@ impl WalletChainStore { .entry(account_id) { let entry = entry.get_mut(); - let identifier = entry.accounts + let identifier = entry + .accounts .iter() .find_map(|(id, _)| { - (nssa::AccountId::from((&entry.key_chain.nullifier_public_key, *id)) == account_id) + (nssa::AccountId::from((&entry.key_chain.nullifier_public_key, *id)) + == account_id) .then_some(*id) }) .unwrap_or(0);