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

Commit 834fc02

Browse files
committed
update token client
1 parent 76d1881 commit 834fc02

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

token/client/src/token.rs

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ impl ExtensionInitializationParams {
301301
token_program_id,
302302
mint,
303303
authority,
304-
withdraw_withheld_authority_elgamal_pubkey,
304+
&withdraw_withheld_authority_elgamal_pubkey,
305305
)
306306
}
307307
Self::GroupPointer {
@@ -2002,14 +2002,14 @@ where
20022002
)
20032003
.unwrap();
20042004

2005-
let decryptable_balance = aes_key.encrypt(0);
2005+
let decryptable_balance = aes_key.encrypt(0).into();
20062006

20072007
self.process_ixs(
20082008
&confidential_transfer::instruction::configure_account(
20092009
&self.program_id,
20102010
account,
20112011
&self.pubkey,
2012-
decryptable_balance.into(),
2012+
&decryptable_balance,
20132013
maximum_pending_balance_credit_counter,
20142014
authority,
20152015
&multisig_signers,
@@ -2216,7 +2216,8 @@ where
22162216

22172217
let new_decryptable_available_balance = account_info
22182218
.new_decryptable_available_balance(withdraw_amount, aes_key)
2219-
.map_err(|_| TokenError::AccountDecryption)?;
2219+
.map_err(|_| TokenError::AccountDecryption)?
2220+
.into();
22202221

22212222
self.process_ixs(
22222223
&confidential_transfer::instruction::withdraw(
@@ -2225,7 +2226,7 @@ where
22252226
&self.pubkey,
22262227
withdraw_amount,
22272228
decimals,
2228-
new_decryptable_available_balance.into(),
2229+
&new_decryptable_available_balance,
22292230
authority,
22302231
&multisig_signers,
22312232
equality_proof_location,
@@ -2351,14 +2352,15 @@ where
23512352

23522353
let new_decryptable_available_balance = account_info
23532354
.new_decryptable_available_balance(transfer_amount, source_aes_key)
2354-
.map_err(|_| TokenError::AccountDecryption)?;
2355+
.map_err(|_| TokenError::AccountDecryption)?
2356+
.into();
23552357

23562358
let mut instructions = confidential_transfer::instruction::transfer(
23572359
&self.program_id,
23582360
source_account,
23592361
self.get_address(),
23602362
destination_account,
2361-
new_decryptable_available_balance.into(),
2363+
&new_decryptable_available_balance,
23622364
&transfer_amount_auditor_ciphertext_lo,
23632365
&transfer_amount_auditor_ciphertext_hi,
23642366
source_authority,
@@ -2745,14 +2747,15 @@ where
27452747

27462748
let new_decryptable_available_balance = account_info
27472749
.new_decryptable_available_balance(transfer_amount, source_aes_key)
2748-
.map_err(|_| TokenError::AccountDecryption)?;
2750+
.map_err(|_| TokenError::AccountDecryption)?
2751+
.into();
27492752

27502753
let mut instructions = confidential_transfer::instruction::transfer_with_fee(
27512754
&self.program_id,
27522755
source_account,
27532756
self.get_address(),
27542757
destination_account,
2755-
new_decryptable_available_balance.into(),
2758+
&new_decryptable_available_balance,
27562759
&transfer_amount_auditor_ciphertext_lo,
27572760
&transfer_amount_auditor_ciphertext_hi,
27582761
source_authority,
@@ -2807,14 +2810,15 @@ where
28072810
let expected_pending_balance_credit_counter = account_info.pending_balance_credit_counter();
28082811
let new_decryptable_available_balance = account_info
28092812
.new_decryptable_available_balance(elgamal_secret_key, aes_key)
2810-
.map_err(|_| TokenError::AccountDecryption)?;
2813+
.map_err(|_| TokenError::AccountDecryption)?
2814+
.into();
28112815

28122816
self.process_ixs(
28132817
&[confidential_transfer::instruction::apply_pending_balance(
28142818
&self.program_id,
28152819
account,
28162820
expected_pending_balance_credit_counter,
2817-
new_decryptable_available_balance.into(),
2821+
&new_decryptable_available_balance,
28182822
authority,
28192823
&multisig_signers,
28202824
)?],

0 commit comments

Comments
 (0)