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

Commit 310404d

Browse files
committed
update tests
1 parent e4dbeb1 commit 310404d

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

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

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ use {
77
transfer::TransferProofContext, transfer_with_fee::TransferWithFeeProofContext,
88
},
99
spl_token_confidential_transfer_proof_generation::{
10-
transfer::transfer_split_proof_data, transfer_with_fee::transfer_with_fee_split_proof_data,
10+
transfer::{transfer_split_proof_data, TransferProofData},
11+
transfer_with_fee::{transfer_with_fee_split_proof_data, TransferWithFeeProofData},
1112
},
1213
};
1314

@@ -35,7 +36,11 @@ fn test_transfer_proof_validity(spendable_balance: u64, transfer_amount: u64) {
3536
let spendable_ciphertext = source_keypair.pubkey().encrypt(spendable_balance);
3637
let decryptable_balance = aes_key.encrypt(spendable_balance);
3738

38-
let (equality_proof_data, validity_proof_data, range_proof_data) = transfer_split_proof_data(
39+
let TransferProofData {
40+
equality_proof_data,
41+
ciphertext_validity_proof_data,
42+
range_proof_data,
43+
} = transfer_split_proof_data(
3944
&spendable_ciphertext,
4045
&decryptable_balance,
4146
transfer_amount,
@@ -47,12 +52,12 @@ fn test_transfer_proof_validity(spendable_balance: u64, transfer_amount: u64) {
4752
.unwrap();
4853

4954
equality_proof_data.verify_proof().unwrap();
50-
validity_proof_data.verify_proof().unwrap();
55+
ciphertext_validity_proof_data.verify_proof().unwrap();
5156
range_proof_data.verify_proof().unwrap();
5257

5358
TransferProofContext::verify_and_extract(
5459
equality_proof_data.context_data(),
55-
validity_proof_data.context_data(),
60+
ciphertext_validity_proof_data.context_data(),
5661
range_proof_data.context_data(),
5762
)
5863
.unwrap();
@@ -101,13 +106,13 @@ fn test_transfer_with_fee_proof_validity(
101106
let spendable_ciphertext = source_keypair.pubkey().encrypt(spendable_balance);
102107
let decryptable_balance = aes_key.encrypt(spendable_balance);
103108

104-
let (
109+
let TransferWithFeeProofData {
105110
equality_proof_data,
106111
transfer_amount_ciphertext_validity_proof_data,
107112
percentage_with_cap_proof_data,
108113
fee_ciphertext_validity_proof_data,
109114
range_proof_data,
110-
) = transfer_with_fee_split_proof_data(
115+
} = transfer_with_fee_split_proof_data(
111116
&spendable_ciphertext,
112117
&decryptable_balance,
113118
transfer_amount,

0 commit comments

Comments
 (0)