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

Commit 92c3b81

Browse files
committed
update tests
1 parent 7ff9bf2 commit 92c3b81

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

token/confidential-transfer/proof-tests/tests/proof_test.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ use {
88
withdraw::WithdrawProofContext,
99
},
1010
spl_token_confidential_transfer_proof_generation::{
11-
transfer::transfer_split_proof_data,
12-
transfer_with_fee::transfer_with_fee_split_proof_data,
11+
transfer::{transfer_split_proof_data, TransferProofData},
12+
transfer_with_fee::{transfer_with_fee_split_proof_data, TransferWithFeeProofData},
1313
withdraw::{withdraw_proof_data, WithdrawProofData},
1414
},
1515
};
@@ -38,7 +38,11 @@ fn test_transfer_proof_validity(spendable_balance: u64, transfer_amount: u64) {
3838
let spendable_ciphertext = source_keypair.pubkey().encrypt(spendable_balance);
3939
let decryptable_balance = aes_key.encrypt(spendable_balance);
4040

41-
let (equality_proof_data, validity_proof_data, range_proof_data) = transfer_split_proof_data(
41+
let TransferProofData {
42+
equality_proof_data,
43+
ciphertext_validity_proof_data,
44+
range_proof_data,
45+
} = transfer_split_proof_data(
4246
&spendable_ciphertext,
4347
&decryptable_balance,
4448
transfer_amount,
@@ -50,12 +54,12 @@ fn test_transfer_proof_validity(spendable_balance: u64, transfer_amount: u64) {
5054
.unwrap();
5155

5256
equality_proof_data.verify_proof().unwrap();
53-
validity_proof_data.verify_proof().unwrap();
57+
ciphertext_validity_proof_data.verify_proof().unwrap();
5458
range_proof_data.verify_proof().unwrap();
5559

5660
TransferProofContext::verify_and_extract(
5761
equality_proof_data.context_data(),
58-
validity_proof_data.context_data(),
62+
ciphertext_validity_proof_data.context_data(),
5963
range_proof_data.context_data(),
6064
)
6165
.unwrap();
@@ -104,13 +108,13 @@ fn test_transfer_with_fee_proof_validity(
104108
let spendable_ciphertext = source_keypair.pubkey().encrypt(spendable_balance);
105109
let decryptable_balance = aes_key.encrypt(spendable_balance);
106110

107-
let (
111+
let TransferWithFeeProofData {
108112
equality_proof_data,
109113
transfer_amount_ciphertext_validity_proof_data,
110114
percentage_with_cap_proof_data,
111115
fee_ciphertext_validity_proof_data,
112116
range_proof_data,
113-
) = transfer_with_fee_split_proof_data(
117+
} = transfer_with_fee_split_proof_data(
114118
&spendable_ciphertext,
115119
&decryptable_balance,
116120
transfer_amount,

0 commit comments

Comments
 (0)