mirror of
https://github.com/logos-blockchain/logos-execution-zone.git
synced 2026-05-08 17:19:45 +00:00
add identifier to PrivacyPreservingAccount to allow passing different identifiers
This commit is contained in:
parent
985f610cea
commit
8fd25bc4bf
@ -16,6 +16,7 @@ pub enum PrivacyPreservingAccount {
|
||||
PrivateForeign {
|
||||
npk: NullifierPublicKey,
|
||||
vpk: ViewingPublicKey,
|
||||
identifier: Identifier,
|
||||
},
|
||||
}
|
||||
|
||||
@ -29,7 +30,7 @@ impl PrivacyPreservingAccount {
|
||||
pub const fn is_private(&self) -> bool {
|
||||
matches!(
|
||||
&self,
|
||||
Self::PrivateOwned(_) | Self::PrivateForeign { npk: _, vpk: _ }
|
||||
Self::PrivateOwned(_) | Self::PrivateForeign { npk: _, vpk: _, identifier: _ }
|
||||
)
|
||||
}
|
||||
}
|
||||
@ -82,13 +83,13 @@ impl AccountManager {
|
||||
|
||||
(State::Private(pre), mask)
|
||||
}
|
||||
PrivacyPreservingAccount::PrivateForeign { npk, vpk } => {
|
||||
PrivacyPreservingAccount::PrivateForeign { npk, vpk, identifier } => {
|
||||
let acc = nssa_core::account::Account::default();
|
||||
let auth_acc = AccountWithMetadata::new(acc, false, (&npk, 0));
|
||||
let auth_acc = AccountWithMetadata::new(acc, false, (&npk, identifier));
|
||||
let pre = AccountPreparedData {
|
||||
nsk: None,
|
||||
npk,
|
||||
identifier: 0,
|
||||
identifier,
|
||||
vpk,
|
||||
pre_state: auth_acc,
|
||||
proof: None,
|
||||
|
||||
@ -44,6 +44,7 @@ impl NativeTokenTransfer<'_> {
|
||||
PrivacyPreservingAccount::PrivateForeign {
|
||||
npk: to_npk,
|
||||
vpk: to_vpk,
|
||||
identifier: 0,
|
||||
},
|
||||
],
|
||||
instruction_data,
|
||||
|
||||
@ -50,6 +50,7 @@ impl NativeTokenTransfer<'_> {
|
||||
PrivacyPreservingAccount::PrivateForeign {
|
||||
npk: to_npk,
|
||||
vpk: to_vpk,
|
||||
identifier: 0,
|
||||
},
|
||||
],
|
||||
instruction_data,
|
||||
|
||||
@ -262,6 +262,7 @@ impl Token<'_> {
|
||||
PrivacyPreservingAccount::PrivateForeign {
|
||||
npk: recipient_npk,
|
||||
vpk: recipient_vpk,
|
||||
identifier: 0,
|
||||
},
|
||||
],
|
||||
instruction_data,
|
||||
@ -358,6 +359,7 @@ impl Token<'_> {
|
||||
PrivacyPreservingAccount::PrivateForeign {
|
||||
npk: recipient_npk,
|
||||
vpk: recipient_vpk,
|
||||
identifier: 0,
|
||||
},
|
||||
],
|
||||
instruction_data,
|
||||
@ -621,6 +623,7 @@ impl Token<'_> {
|
||||
PrivacyPreservingAccount::PrivateForeign {
|
||||
npk: holder_npk,
|
||||
vpk: holder_vpk,
|
||||
identifier: 0,
|
||||
},
|
||||
],
|
||||
instruction_data,
|
||||
@ -717,6 +720,7 @@ impl Token<'_> {
|
||||
PrivacyPreservingAccount::PrivateForeign {
|
||||
npk: holder_npk,
|
||||
vpk: holder_vpk,
|
||||
identifier: 0,
|
||||
},
|
||||
],
|
||||
instruction_data,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user