diff --git a/examples/program_deployment/README.md b/examples/program_deployment/README.md index 61e530e3..11952c35 100644 --- a/examples/program_deployment/README.md +++ b/examples/program_deployment/README.md @@ -332,7 +332,7 @@ Unlike the public version, `run_hello_world_private.rs` must: Luckily all that complexity is hidden behind the `wallet_core.send_privacy_preserving_tx` function: ```rust - let accounts = vec![PrivacyPreservingAccount::PrivateOwned(account_id)]; + let accounts = vec![AccountIdentity::PrivateOwned(account_id)]; // Construct and submit the privacy-preserving transaction wallet_core diff --git a/wallet/src/account_manager.rs b/wallet/src/account_manager.rs index a088bcd6..2d1127c5 100644 --- a/wallet/src/account_manager.rs +++ b/wallet/src/account_manager.rs @@ -54,6 +54,8 @@ pub enum AccountIdentity { impl AccountIdentity { #[must_use] + /// Note: `PublicNoSign` still counts as public, the variant just suppresses the signing-key + /// lookup. pub const fn is_public(&self) -> bool { matches!(&self, Self::Public(_) | Self::PublicNoSign(_)) } diff --git a/wallet/src/lib.rs b/wallet/src/lib.rs index fa60b18c..ba368355 100644 --- a/wallet/src/lib.rs +++ b/wallet/src/lib.rs @@ -270,7 +270,7 @@ impl WalletCore { self.storage.key_chain_mut().set_sealing_secret_key(key); } - /// Resolve an `AccountId` to the appropriate `PrivacyPreservingAccount` variant. + /// Resolve an `AccountId` to the appropriate `AccountIdentity` variant. /// Checks the key tree first, then shared private accounts. #[must_use] pub fn resolve_private_account(&self, account_id: nssa::AccountId) -> Option { diff --git a/wallet/src/program_facades/amm.rs b/wallet/src/program_facades/amm.rs index 2dbab6c5..b84cb5d0 100644 --- a/wallet/src/program_facades/amm.rs +++ b/wallet/src/program_facades/amm.rs @@ -113,13 +113,13 @@ impl Amm<'_> { )); } - let user_a_signing_indentity = if token_definition_id_in == definition_token_a_id { + let user_a_signing_identity = if token_definition_id_in == definition_token_a_id { AccountIdentity::Public(user_holding_a) } else { AccountIdentity::PublicNoSign(user_holding_a) }; - let user_b_signing_indentity = if token_definition_id_in == definition_token_b_id { + let user_b_signing_identity = if token_definition_id_in == definition_token_b_id { AccountIdentity::Public(user_holding_b) } else { AccountIdentity::PublicNoSign(user_holding_b) @@ -131,8 +131,8 @@ impl Amm<'_> { AccountIdentity::PublicNoSign(amm_pool), AccountIdentity::PublicNoSign(vault_holding_a), AccountIdentity::PublicNoSign(vault_holding_b), - user_a_signing_indentity, - user_b_signing_indentity, + user_a_signing_identity, + user_b_signing_identity, ], instruction_data, &program.into(), @@ -188,13 +188,13 @@ impl Amm<'_> { )); } - let user_a_signing_indentity = if token_definition_id_in == definition_token_a_id { + let user_a_signing_identity = if token_definition_id_in == definition_token_a_id { AccountIdentity::Public(user_holding_a) } else { AccountIdentity::PublicNoSign(user_holding_a) }; - let user_b_signing_indentity = if token_definition_id_in == definition_token_b_id { + let user_b_signing_identity = if token_definition_id_in == definition_token_b_id { AccountIdentity::Public(user_holding_b) } else { AccountIdentity::PublicNoSign(user_holding_b) @@ -203,11 +203,11 @@ impl Amm<'_> { self.0 .send_pub_tx( vec![ - AccountIdentity::Public(amm_pool), - AccountIdentity::Public(vault_holding_a), - AccountIdentity::Public(vault_holding_b), - user_a_signing_indentity, - user_b_signing_indentity, + AccountIdentity::PublicNoSign(amm_pool), + AccountIdentity::PublicNoSign(vault_holding_a), + AccountIdentity::PublicNoSign(vault_holding_b), + user_a_signing_identity, + user_b_signing_identity, ], instruction_data, &program.into(),