mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-06-03 15:49:48 +00:00
update facades to receive identifiers
This commit is contained in:
parent
8fd25bc4bf
commit
4ab8696d85
@ -160,7 +160,7 @@ pub unsafe extern "C" fn wallet_ffi_transfer_shielded(
|
|||||||
let transfer = NativeTokenTransfer(&wallet);
|
let transfer = NativeTokenTransfer(&wallet);
|
||||||
|
|
||||||
match block_on(
|
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)) => {
|
Ok((tx_hash, _shared_key)) => {
|
||||||
let tx_hash = CString::new(tx_hash.to_string())
|
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);
|
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)) => {
|
Ok((tx_hash, _shared_key)) => {
|
||||||
let tx_hash = CString::new(tx_hash.to_string())
|
let tx_hash = CString::new(tx_hash.to_string())
|
||||||
|
|||||||
@ -397,7 +397,7 @@ impl WalletSubcommand for NativeTokenTransferProgramSubcommandPrivate {
|
|||||||
nssa_core::encryption::shared_key_derivation::Secp256k1Point(to_vpk.to_vec());
|
nssa_core::encryption::shared_key_derivation::Secp256k1Point(to_vpk.to_vec());
|
||||||
|
|
||||||
let (tx_hash, [secret_from, _]) = NativeTokenTransfer(wallet_core)
|
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?;
|
.await?;
|
||||||
|
|
||||||
println!("Transaction hash is {tx_hash}");
|
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());
|
nssa_core::encryption::shared_key_derivation::Secp256k1Point(to_vpk.to_vec());
|
||||||
|
|
||||||
let (tx_hash, _) = NativeTokenTransfer(wallet_core)
|
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?;
|
.await?;
|
||||||
|
|
||||||
println!("Transaction hash is {tx_hash}");
|
println!("Transaction hash is {tx_hash}");
|
||||||
|
|||||||
@ -882,6 +882,7 @@ impl WalletSubcommand for TokenProgramSubcommandPrivate {
|
|||||||
sender_account_id,
|
sender_account_id,
|
||||||
recipient_npk,
|
recipient_npk,
|
||||||
recipient_vpk,
|
recipient_vpk,
|
||||||
|
0,
|
||||||
balance_to_move,
|
balance_to_move,
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
@ -1000,6 +1001,7 @@ impl WalletSubcommand for TokenProgramSubcommandPrivate {
|
|||||||
definition_account_id,
|
definition_account_id,
|
||||||
holder_npk,
|
holder_npk,
|
||||||
holder_vpk,
|
holder_vpk,
|
||||||
|
0,
|
||||||
amount,
|
amount,
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
@ -1164,6 +1166,7 @@ impl WalletSubcommand for TokenProgramSubcommandShielded {
|
|||||||
sender_account_id,
|
sender_account_id,
|
||||||
recipient_npk,
|
recipient_npk,
|
||||||
recipient_vpk,
|
recipient_vpk,
|
||||||
|
0,
|
||||||
balance_to_move,
|
balance_to_move,
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
@ -1304,6 +1307,7 @@ impl WalletSubcommand for TokenProgramSubcommandShielded {
|
|||||||
definition_account_id,
|
definition_account_id,
|
||||||
holder_npk,
|
holder_npk,
|
||||||
holder_vpk,
|
holder_vpk,
|
||||||
|
0,
|
||||||
amount,
|
amount,
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|||||||
@ -2,7 +2,7 @@ use std::vec;
|
|||||||
|
|
||||||
use common::HashType;
|
use common::HashType;
|
||||||
use nssa::{AccountId, program::Program};
|
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 super::{NativeTokenTransfer, auth_transfer_preparation};
|
||||||
use crate::{ExecutionFailureKind, PrivacyPreservingAccount};
|
use crate::{ExecutionFailureKind, PrivacyPreservingAccount};
|
||||||
@ -33,6 +33,7 @@ impl NativeTokenTransfer<'_> {
|
|||||||
from: AccountId,
|
from: AccountId,
|
||||||
to_npk: NullifierPublicKey,
|
to_npk: NullifierPublicKey,
|
||||||
to_vpk: ViewingPublicKey,
|
to_vpk: ViewingPublicKey,
|
||||||
|
to_identifier: Identifier,
|
||||||
balance_to_move: u128,
|
balance_to_move: u128,
|
||||||
) -> Result<(HashType, [SharedSecretKey; 2]), ExecutionFailureKind> {
|
) -> Result<(HashType, [SharedSecretKey; 2]), ExecutionFailureKind> {
|
||||||
let (instruction_data, program, tx_pre_check) = auth_transfer_preparation(balance_to_move);
|
let (instruction_data, program, tx_pre_check) = auth_transfer_preparation(balance_to_move);
|
||||||
@ -44,7 +45,7 @@ impl NativeTokenTransfer<'_> {
|
|||||||
PrivacyPreservingAccount::PrivateForeign {
|
PrivacyPreservingAccount::PrivateForeign {
|
||||||
npk: to_npk,
|
npk: to_npk,
|
||||||
vpk: to_vpk,
|
vpk: to_vpk,
|
||||||
identifier: 0,
|
identifier: to_identifier,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
instruction_data,
|
instruction_data,
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
use common::HashType;
|
use common::HashType;
|
||||||
use nssa::AccountId;
|
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 super::{NativeTokenTransfer, auth_transfer_preparation};
|
||||||
use crate::{ExecutionFailureKind, PrivacyPreservingAccount};
|
use crate::{ExecutionFailureKind, PrivacyPreservingAccount};
|
||||||
@ -39,6 +39,7 @@ impl NativeTokenTransfer<'_> {
|
|||||||
from: AccountId,
|
from: AccountId,
|
||||||
to_npk: NullifierPublicKey,
|
to_npk: NullifierPublicKey,
|
||||||
to_vpk: ViewingPublicKey,
|
to_vpk: ViewingPublicKey,
|
||||||
|
to_identifier: Identifier,
|
||||||
balance_to_move: u128,
|
balance_to_move: u128,
|
||||||
) -> Result<(HashType, SharedSecretKey), ExecutionFailureKind> {
|
) -> Result<(HashType, SharedSecretKey), ExecutionFailureKind> {
|
||||||
let (instruction_data, program, tx_pre_check) = auth_transfer_preparation(balance_to_move);
|
let (instruction_data, program, tx_pre_check) = auth_transfer_preparation(balance_to_move);
|
||||||
@ -50,7 +51,7 @@ impl NativeTokenTransfer<'_> {
|
|||||||
PrivacyPreservingAccount::PrivateForeign {
|
PrivacyPreservingAccount::PrivateForeign {
|
||||||
npk: to_npk,
|
npk: to_npk,
|
||||||
vpk: to_vpk,
|
vpk: to_vpk,
|
||||||
identifier: 0,
|
identifier: to_identifier,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
instruction_data,
|
instruction_data,
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
use common::{HashType, transaction::NSSATransaction};
|
use common::{HashType, transaction::NSSATransaction};
|
||||||
use nssa::{AccountId, program::Program};
|
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 sequencer_service_rpc::RpcClient as _;
|
||||||
use token_core::Instruction;
|
use token_core::Instruction;
|
||||||
|
|
||||||
@ -247,6 +247,7 @@ impl Token<'_> {
|
|||||||
sender_account_id: AccountId,
|
sender_account_id: AccountId,
|
||||||
recipient_npk: NullifierPublicKey,
|
recipient_npk: NullifierPublicKey,
|
||||||
recipient_vpk: ViewingPublicKey,
|
recipient_vpk: ViewingPublicKey,
|
||||||
|
recipient_identifier: Identifier,
|
||||||
amount: u128,
|
amount: u128,
|
||||||
) -> Result<(HashType, [SharedSecretKey; 2]), ExecutionFailureKind> {
|
) -> Result<(HashType, [SharedSecretKey; 2]), ExecutionFailureKind> {
|
||||||
let instruction = Instruction::Transfer {
|
let instruction = Instruction::Transfer {
|
||||||
@ -262,7 +263,7 @@ impl Token<'_> {
|
|||||||
PrivacyPreservingAccount::PrivateForeign {
|
PrivacyPreservingAccount::PrivateForeign {
|
||||||
npk: recipient_npk,
|
npk: recipient_npk,
|
||||||
vpk: recipient_vpk,
|
vpk: recipient_vpk,
|
||||||
identifier: 0,
|
identifier: recipient_identifier,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
instruction_data,
|
instruction_data,
|
||||||
@ -344,6 +345,7 @@ impl Token<'_> {
|
|||||||
sender_account_id: AccountId,
|
sender_account_id: AccountId,
|
||||||
recipient_npk: NullifierPublicKey,
|
recipient_npk: NullifierPublicKey,
|
||||||
recipient_vpk: ViewingPublicKey,
|
recipient_vpk: ViewingPublicKey,
|
||||||
|
recipient_identifier: Identifier,
|
||||||
amount: u128,
|
amount: u128,
|
||||||
) -> Result<(HashType, SharedSecretKey), ExecutionFailureKind> {
|
) -> Result<(HashType, SharedSecretKey), ExecutionFailureKind> {
|
||||||
let instruction = Instruction::Transfer {
|
let instruction = Instruction::Transfer {
|
||||||
@ -359,7 +361,7 @@ impl Token<'_> {
|
|||||||
PrivacyPreservingAccount::PrivateForeign {
|
PrivacyPreservingAccount::PrivateForeign {
|
||||||
npk: recipient_npk,
|
npk: recipient_npk,
|
||||||
vpk: recipient_vpk,
|
vpk: recipient_vpk,
|
||||||
identifier: 0,
|
identifier: recipient_identifier,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
instruction_data,
|
instruction_data,
|
||||||
@ -608,6 +610,7 @@ impl Token<'_> {
|
|||||||
definition_account_id: AccountId,
|
definition_account_id: AccountId,
|
||||||
holder_npk: NullifierPublicKey,
|
holder_npk: NullifierPublicKey,
|
||||||
holder_vpk: ViewingPublicKey,
|
holder_vpk: ViewingPublicKey,
|
||||||
|
holder_identifier: Identifier,
|
||||||
amount: u128,
|
amount: u128,
|
||||||
) -> Result<(HashType, [SharedSecretKey; 2]), ExecutionFailureKind> {
|
) -> Result<(HashType, [SharedSecretKey; 2]), ExecutionFailureKind> {
|
||||||
let instruction = Instruction::Mint {
|
let instruction = Instruction::Mint {
|
||||||
@ -623,7 +626,7 @@ impl Token<'_> {
|
|||||||
PrivacyPreservingAccount::PrivateForeign {
|
PrivacyPreservingAccount::PrivateForeign {
|
||||||
npk: holder_npk,
|
npk: holder_npk,
|
||||||
vpk: holder_vpk,
|
vpk: holder_vpk,
|
||||||
identifier: 0,
|
identifier: holder_identifier,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
instruction_data,
|
instruction_data,
|
||||||
@ -705,6 +708,7 @@ impl Token<'_> {
|
|||||||
definition_account_id: AccountId,
|
definition_account_id: AccountId,
|
||||||
holder_npk: NullifierPublicKey,
|
holder_npk: NullifierPublicKey,
|
||||||
holder_vpk: ViewingPublicKey,
|
holder_vpk: ViewingPublicKey,
|
||||||
|
holder_identifier: Identifier,
|
||||||
amount: u128,
|
amount: u128,
|
||||||
) -> Result<(HashType, SharedSecretKey), ExecutionFailureKind> {
|
) -> Result<(HashType, SharedSecretKey), ExecutionFailureKind> {
|
||||||
let instruction = Instruction::Mint {
|
let instruction = Instruction::Mint {
|
||||||
@ -720,7 +724,7 @@ impl Token<'_> {
|
|||||||
PrivacyPreservingAccount::PrivateForeign {
|
PrivacyPreservingAccount::PrivateForeign {
|
||||||
npk: holder_npk,
|
npk: holder_npk,
|
||||||
vpk: holder_vpk,
|
vpk: holder_vpk,
|
||||||
identifier: 0,
|
identifier: holder_identifier,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
instruction_data,
|
instruction_data,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user