fix: merge update

This commit is contained in:
Oleksandr Pravdyvyi 2025-10-15 15:29:28 +03:00
parent 8e3fb2f67b
commit 5010c6c370
No known key found for this signature in database
GPG Key ID: 9F8955C63C443871
2 changed files with 18 additions and 20 deletions

View File

@ -188,27 +188,29 @@ impl WalletSubcommand for TokenProgramSubcommandPrivate {
let sender_addr: Address = sender_addr.parse().unwrap();
let recipient_addr: Address = recipient_addr.parse().unwrap();
let recipient_initialized = wallet_core
let recipient_initialization = wallet_core
.check_private_account_initialized(&recipient_addr)
.await;
.await?;
let (res, [secret_sender, secret_recipient]) = if recipient_initialized {
wallet_core
let (res, [secret_sender, secret_recipient]) =
if let Some(recipient_proof) = recipient_initialization {
wallet_core
.send_transfer_token_transaction_private_owned_account_already_initialized(
sender_addr,
recipient_addr,
balance_to_move,
recipient_proof,
)
.await?
} else {
wallet_core
.send_transfer_token_transaction_private_owned_account_not_initialized(
sender_addr,
recipient_addr,
balance_to_move,
)
.await?
};
} else {
wallet_core
.send_transfer_token_transaction_private_owned_account_not_initialized(
sender_addr,
recipient_addr,
balance_to_move,
)
.await?
};
println!("Results of tx send is {res:#?}");

View File

@ -2,7 +2,7 @@ use common::{ExecutionFailureKind, sequencer_client::json::SendTxResponse};
use key_protocol::key_management::ephemeral_key_holder::EphemeralKeyHolder;
use nssa::{Address, privacy_preserving_transaction::circuit, program::Program};
use nssa_core::{
Commitment, NullifierPublicKey, SharedSecretKey, account::AccountWithMetadata,
Commitment, MembershipProof, NullifierPublicKey, SharedSecretKey, account::AccountWithMetadata,
encryption::IncomingViewingPublicKey,
};
@ -146,6 +146,7 @@ impl WalletCore {
sender_address: Address,
recipient_address: Address,
amount: u128,
recipient_proof: MembershipProof,
) -> Result<(SendTxResponse, [SharedSecretKey; 2]), ExecutionFailureKind> {
let Some((sender_keys, sender_acc)) = self
.storage
@ -173,7 +174,6 @@ impl WalletCore {
let program = Program::token();
let sender_commitment = Commitment::new(&sender_npk, &sender_acc);
let receiver_commitment = Commitment::new(&recipient_npk, &recipient_acc);
let sender_pre = AccountWithMetadata::new(sender_acc.clone(), true, &sender_npk);
let recipient_pre = AccountWithMetadata::new(recipient_acc.clone(), true, &recipient_npk);
@ -210,11 +210,7 @@ impl WalletCore {
),
(
recipient_keys.private_key_holder.nullifier_secret_key,
self.sequencer_client
.get_proof_for_commitment(receiver_commitment)
.await
.unwrap()
.unwrap(),
recipient_proof,
),
],
&program,