Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 4ddaae5

Browse files
Bump zk token sdk (#3002)
* token-2022: bumping zk-token-sdk to 1.10.1-pre1 and updating variable names accordingly * token-2022: updating client and test variables to match newest zk-token-sdk
1 parent 56a1e97 commit 4ddaae5

File tree

7 files changed

+93
-61
lines changed

7 files changed

+93
-61
lines changed

Cargo.lock

Lines changed: 39 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

token/client/src/token.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,8 +1126,8 @@ where
11261126
),
11271127
source_elgamal_keypair,
11281128
(
1129-
&destination_extension.pubkey_elgamal.try_into().unwrap(),
1130-
&ct_mint.pubkey_auditor.try_into().unwrap(),
1129+
&destination_extension.encryption_pubkey.try_into().unwrap(),
1130+
&ct_mint.auditor_pubkey.try_into().unwrap(),
11311131
),
11321132
)
11331133
.map_err(TokenError::Proof)?;

token/program-2022-test/tests/confidential_transfer.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ impl ConfidentialTransferMintWithKeypairs {
4545
let ct_mint = ConfidentialTransferMint {
4646
authority: ct_mint_authority.pubkey().into(),
4747
auto_approve_new_accounts: true.into(),
48-
pubkey_auditor: ct_mint_transfer_auditor.public.into(),
49-
pubkey_withdraw_withheld_authority: ct_mint_withdraw_withheld_authority.public.into(),
48+
auditor_pubkey: ct_mint_transfer_auditor.public.into(),
49+
withdraw_withheld_authority_pubkey: ct_mint_withdraw_withheld_authority.public.into(),
5050
withheld_amount: EncryptedWithheldAmount::zeroed(),
5151
};
5252
Self {
@@ -235,7 +235,7 @@ async fn ct_configure_token_account() {
235235
assert!(!bool::from(&extension.approved));
236236
assert!(bool::from(&extension.allow_balance_credits));
237237
assert_eq!(
238-
extension.pubkey_elgamal,
238+
extension.encryption_pubkey,
239239
alice_meta.elgamal_keypair.public.into()
240240
);
241241
assert_eq!(

token/program-2022/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ num-derive = "0.3"
2424
num-traits = "0.2"
2525
num_enum = "0.5.4"
2626
solana-program = "1.9.9"
27-
solana-zk-token-sdk = "0.8.1"
27+
solana-zk-token-sdk = "1.10.1-pre1"
2828
spl-memo = { version = "3.0.1", path = "../../memo/program", features = [ "no-entrypoint" ] }
2929
spl-token = { version = "3.3", path = "../program", features = ["no-entrypoint"] }
3030
thiserror = "1.0"

token/program-2022/src/extension/confidential_transfer/instruction.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ pub enum ConfidentialTransferInstruction {
353353
#[repr(C)]
354354
pub struct ConfigureAccountInstructionData {
355355
/// The public key associated with the account
356-
pub elgamal_pubkey: EncryptionPubkey,
356+
pub encryption_pubkey: EncryptionPubkey,
357357
/// The decryptable balance (always 0) once the configure account succeeds
358358
pub decryptable_zero_balance: DecryptableBalance,
359359
}
@@ -514,7 +514,7 @@ pub fn configure_account(
514514
token_program_id: &Pubkey,
515515
token_account: &Pubkey,
516516
mint: &Pubkey,
517-
elgamal_pubkey: ElGamalPubkey,
517+
encryption_pubkey: ElGamalPubkey,
518518
decryptable_zero_balance: AeCiphertext,
519519
authority: &Pubkey,
520520
multisig_signers: &[&Pubkey],
@@ -535,7 +535,7 @@ pub fn configure_account(
535535
accounts,
536536
ConfidentialTransferInstruction::ConfigureAccount,
537537
&ConfigureAccountInstructionData {
538-
elgamal_pubkey: elgamal_pubkey.into(),
538+
encryption_pubkey: encryption_pubkey.into(),
539539
decryptable_zero_balance: decryptable_zero_balance.into(),
540540
},
541541
))

token/program-2022/src/extension/confidential_transfer/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ pub struct ConfidentialTransferMint {
5050
/// * If non-zero, transfers must include ElGamal cypertext with this public key permitting the
5151
/// auditor to decode the transfer amount.
5252
/// * If all zero, auditing is currently disabled.
53-
pub pubkey_auditor: EncryptionPubkey,
53+
pub auditor_pubkey: EncryptionPubkey,
5454

5555
/// * If non-zero, transfers must include ElGamal cypertext of the transfer fee with this
5656
/// public key. If this is the case, but the base mint is not extended for fees, then any
5757
/// transfer will fail.
5858
/// * If all zero, transfer fee is disabled. If this is the case, but the base mint is extended
5959
/// for fees, then any transfer will fail.
60-
pub pubkey_withdraw_withheld_authority: EncryptionPubkey,
60+
pub withdraw_withheld_authority_pubkey: EncryptionPubkey,
6161

6262
/// Withheld transfer fee confidential tokens that have been moved to the mint for withdrawal.
6363
/// This will always be zero if fees are never enabled.
@@ -77,7 +77,7 @@ pub struct ConfidentialTransferAccount {
7777
pub approved: PodBool,
7878

7979
/// The public key associated with ElGamal encryption
80-
pub pubkey_elgamal: EncryptionPubkey,
80+
pub encryption_pubkey: EncryptionPubkey,
8181

8282
/// The pending balance (encrypted by `pubkey_elgamal`)
8383
pub pending_balance: EncryptedBalance,

0 commit comments

Comments
 (0)