update facades to receive identifiers

This commit is contained in:
Sergio Chouhy 2026-04-15 17:21:16 -03:00
parent 8fd25bc4bf
commit 4ab8696d85
6 changed files with 23 additions and 13 deletions

View File

@ -160,7 +160,7 @@ pub unsafe extern "C" fn wallet_ffi_transfer_shielded(
let transfer = NativeTokenTransfer(&wallet);
match block_on(
transfer.send_shielded_transfer_to_outer_account(from_id, to_npk, to_vpk, amount),
transfer.send_shielded_transfer_to_outer_account(from_id, to_npk, to_vpk, 0, amount),
) {
Ok((tx_hash, _shared_key)) => {
let tx_hash = CString::new(tx_hash.to_string())
@ -328,7 +328,7 @@ pub unsafe extern "C" fn wallet_ffi_transfer_private(
let transfer = NativeTokenTransfer(&wallet);
match block_on(transfer.send_private_transfer_to_outer_account(from_id, to_npk, to_vpk, amount))
match block_on(transfer.send_private_transfer_to_outer_account(from_id, to_npk, to_vpk, 0, amount))
{
Ok((tx_hash, _shared_key)) => {
let tx_hash = CString::new(tx_hash.to_string())

View File

@ -397,7 +397,7 @@ impl WalletSubcommand for NativeTokenTransferProgramSubcommandPrivate {
nssa_core::encryption::shared_key_derivation::Secp256k1Point(to_vpk.to_vec());
let (tx_hash, [secret_from, _]) = NativeTokenTransfer(wallet_core)
.send_private_transfer_to_outer_account(from, to_npk, to_vpk, amount)
.send_private_transfer_to_outer_account(from, to_npk, to_vpk, 0, amount)
.await?;
println!("Transaction hash is {tx_hash}");
@ -472,7 +472,7 @@ impl WalletSubcommand for NativeTokenTransferProgramSubcommandShielded {
nssa_core::encryption::shared_key_derivation::Secp256k1Point(to_vpk.to_vec());
let (tx_hash, _) = NativeTokenTransfer(wallet_core)
.send_shielded_transfer_to_outer_account(from, to_npk, to_vpk, amount)
.send_shielded_transfer_to_outer_account(from, to_npk, to_vpk, 0, amount)
.await?;
println!("Transaction hash is {tx_hash}");

View File

@ -882,6 +882,7 @@ impl WalletSubcommand for TokenProgramSubcommandPrivate {
sender_account_id,
recipient_npk,
recipient_vpk,
0,
balance_to_move,
)
.await?;
@ -1000,6 +1001,7 @@ impl WalletSubcommand for TokenProgramSubcommandPrivate {
definition_account_id,
holder_npk,
holder_vpk,
0,
amount,
)
.await?;
@ -1164,6 +1166,7 @@ impl WalletSubcommand for TokenProgramSubcommandShielded {
sender_account_id,
recipient_npk,
recipient_vpk,
0,
balance_to_move,
)
.await?;
@ -1304,6 +1307,7 @@ impl WalletSubcommand for TokenProgramSubcommandShielded {
definition_account_id,
holder_npk,
holder_vpk,
0,
amount,
)
.await?;

View File

@ -2,7 +2,7 @@ use std::vec;
use common::HashType;
use nssa::{AccountId, program::Program};
use nssa_core::{NullifierPublicKey, SharedSecretKey, encryption::ViewingPublicKey};
use nssa_core::{Identifier, NullifierPublicKey, SharedSecretKey, encryption::ViewingPublicKey};
use super::{NativeTokenTransfer, auth_transfer_preparation};
use crate::{ExecutionFailureKind, PrivacyPreservingAccount};
@ -33,6 +33,7 @@ impl NativeTokenTransfer<'_> {
from: AccountId,
to_npk: NullifierPublicKey,
to_vpk: ViewingPublicKey,
to_identifier: Identifier,
balance_to_move: u128,
) -> Result<(HashType, [SharedSecretKey; 2]), ExecutionFailureKind> {
let (instruction_data, program, tx_pre_check) = auth_transfer_preparation(balance_to_move);
@ -44,7 +45,7 @@ impl NativeTokenTransfer<'_> {
PrivacyPreservingAccount::PrivateForeign {
npk: to_npk,
vpk: to_vpk,
identifier: 0,
identifier: to_identifier,
},
],
instruction_data,

View File

@ -1,6 +1,6 @@
use common::HashType;
use nssa::AccountId;
use nssa_core::{NullifierPublicKey, SharedSecretKey, encryption::ViewingPublicKey};
use nssa_core::{Identifier, NullifierPublicKey, SharedSecretKey, encryption::ViewingPublicKey};
use super::{NativeTokenTransfer, auth_transfer_preparation};
use crate::{ExecutionFailureKind, PrivacyPreservingAccount};
@ -39,6 +39,7 @@ impl NativeTokenTransfer<'_> {
from: AccountId,
to_npk: NullifierPublicKey,
to_vpk: ViewingPublicKey,
to_identifier: Identifier,
balance_to_move: u128,
) -> Result<(HashType, SharedSecretKey), ExecutionFailureKind> {
let (instruction_data, program, tx_pre_check) = auth_transfer_preparation(balance_to_move);
@ -50,7 +51,7 @@ impl NativeTokenTransfer<'_> {
PrivacyPreservingAccount::PrivateForeign {
npk: to_npk,
vpk: to_vpk,
identifier: 0,
identifier: to_identifier,
},
],
instruction_data,

View File

@ -1,6 +1,6 @@
use common::{HashType, transaction::NSSATransaction};
use nssa::{AccountId, program::Program};
use nssa_core::{NullifierPublicKey, SharedSecretKey, encryption::ViewingPublicKey};
use nssa_core::{Identifier, NullifierPublicKey, SharedSecretKey, encryption::ViewingPublicKey};
use sequencer_service_rpc::RpcClient as _;
use token_core::Instruction;
@ -247,6 +247,7 @@ impl Token<'_> {
sender_account_id: AccountId,
recipient_npk: NullifierPublicKey,
recipient_vpk: ViewingPublicKey,
recipient_identifier: Identifier,
amount: u128,
) -> Result<(HashType, [SharedSecretKey; 2]), ExecutionFailureKind> {
let instruction = Instruction::Transfer {
@ -262,7 +263,7 @@ impl Token<'_> {
PrivacyPreservingAccount::PrivateForeign {
npk: recipient_npk,
vpk: recipient_vpk,
identifier: 0,
identifier: recipient_identifier,
},
],
instruction_data,
@ -344,6 +345,7 @@ impl Token<'_> {
sender_account_id: AccountId,
recipient_npk: NullifierPublicKey,
recipient_vpk: ViewingPublicKey,
recipient_identifier: Identifier,
amount: u128,
) -> Result<(HashType, SharedSecretKey), ExecutionFailureKind> {
let instruction = Instruction::Transfer {
@ -359,7 +361,7 @@ impl Token<'_> {
PrivacyPreservingAccount::PrivateForeign {
npk: recipient_npk,
vpk: recipient_vpk,
identifier: 0,
identifier: recipient_identifier,
},
],
instruction_data,
@ -608,6 +610,7 @@ impl Token<'_> {
definition_account_id: AccountId,
holder_npk: NullifierPublicKey,
holder_vpk: ViewingPublicKey,
holder_identifier: Identifier,
amount: u128,
) -> Result<(HashType, [SharedSecretKey; 2]), ExecutionFailureKind> {
let instruction = Instruction::Mint {
@ -623,7 +626,7 @@ impl Token<'_> {
PrivacyPreservingAccount::PrivateForeign {
npk: holder_npk,
vpk: holder_vpk,
identifier: 0,
identifier: holder_identifier,
},
],
instruction_data,
@ -705,6 +708,7 @@ impl Token<'_> {
definition_account_id: AccountId,
holder_npk: NullifierPublicKey,
holder_vpk: ViewingPublicKey,
holder_identifier: Identifier,
amount: u128,
) -> Result<(HashType, SharedSecretKey), ExecutionFailureKind> {
let instruction = Instruction::Mint {
@ -720,7 +724,7 @@ impl Token<'_> {
PrivacyPreservingAccount::PrivateForeign {
npk: holder_npk,
vpk: holder_vpk,
identifier: 0,
identifier: holder_identifier,
},
],
instruction_data,