diff --git a/nssa/core/src/circuit_io.rs b/nssa/core/src/circuit_io.rs index ebd6a6d9..b5416a50 100644 --- a/nssa/core/src/circuit_io.rs +++ b/nssa/core/src/circuit_io.rs @@ -48,7 +48,7 @@ impl PrivacyPreservingCircuitOutput { } } -/* + #[cfg(feature = "host")] #[cfg(test)] mod tests { @@ -93,12 +93,12 @@ mod tests { }], ciphertexts: vec![Ciphertext(vec![255, 255, 1, 1, 2, 2])], new_commitments: vec![Commitment::new( - &NullifierPublicKey::from(&[1; 32]), + &AccountId::account_id_without_identifier(&NullifierPublicKey::from(&[1_u8;32])), &Account::default(), )], new_nullifiers: vec![( Nullifier::for_account_update( - &Commitment::new(&NullifierPublicKey::from(&[2; 32]), &Account::default()), + &Commitment::new(&AccountId::account_id_without_identifier(&NullifierPublicKey::from(&[2_u8;32])), &Account::default()), &[1; 32], ), [0xab; 32], diff --git a/wallet/src/lib.rs b/wallet/src/lib.rs index a09d477e..7834140e 100644 --- a/wallet/src/lib.rs +++ b/wallet/src/lib.rs @@ -286,8 +286,8 @@ impl WalletCore { #[must_use] pub fn get_private_account_commitment(&self, account_id: AccountId) -> Option { - let (keys, account) = self.storage.user_data.get_private_account(account_id)?; - Some(Commitment::new(&keys.nullifier_public_key, account)) + let (_, account) = self.storage.user_data.get_private_account(account_id)?; + Some(Commitment::new(&account_id, account)) } /// Poll transactions. diff --git a/wallet/src/privacy_preserving_tx.rs b/wallet/src/privacy_preserving_tx.rs index 04056111..bee2039e 100644 --- a/wallet/src/privacy_preserving_tx.rs +++ b/wallet/src/privacy_preserving_tx.rs @@ -82,8 +82,9 @@ impl AccountManager { (State::Private(pre), mask) } PrivacyPreservingAccount::PrivateForeign { npk, vpk } => { + let account_id = AccountId::generate_account_id(&npk, None); let acc = nssa_core::account::Account::default(); - let auth_acc = AccountWithMetadata::new(acc, false, &npk); + let auth_acc = AccountWithMetadata::new(acc, false, account_id); let pre = AccountPreparedData { nsk: None, npk, @@ -224,7 +225,7 @@ async fn private_acc_preparation( // TODO: Technically we could allow unauthorized owned accounts, but currently we don't have // support from that in the wallet. - let sender_pre = AccountWithMetadata::new(from_acc.clone(), true, &from_npk); + let sender_pre = AccountWithMetadata::new(from_acc.clone(), true, account_id); Ok(AccountPreparedData { nsk: Some(nsk),