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

Commit 6666f5e

Browse files
committed
update tests
1 parent e4dbeb1 commit 6666f5e

File tree

4 files changed

+12
-22
lines changed

4 files changed

+12
-22
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,

token/program-2022/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@ exclude = ["js/**"]
1212
no-entrypoint = []
1313
test-sbf = []
1414
serde-traits = ["dep:serde", "dep:serde_with", "dep:base64", "spl-pod/serde-traits"]
15-
default = ["confidential-hook", "token-group", "zk-ops"]
15+
default = ["confidential-hook", "zk-ops"]
1616
# Remove this feature once the underlying syscalls are released on all networks
1717
zk-ops = []
18-
# Remove this feature once the token group implementation has been audited
19-
token-group = []
2018
# Remove this feature once the confidential transfer hook has been audited
2119
confidential-hook = []
2220

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// Remove feature once zk ops syscalls are enabled on all networks
2-
#[cfg(feature = "confidential-hook")]
32
use crate::extension::transfer_hook;
43
#[cfg(feature = "zk-ops")]
54
use {
@@ -625,7 +624,6 @@ fn process_transfer(
625624
authority_info
626625
};
627626

628-
#[cfg(feature = "confidential-hook")]
629627
if let Some(program_id) = transfer_hook::get_program_id(&mint) {
630628
// set transferring flags, scope the borrow to avoid double-borrow during CPI
631629
{

token/program-2022/src/extension/token_group/processor.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ pub fn process_initialize_member(_program_id: &Pubkey, accounts: &[AccountInfo])
205205
}
206206

207207
/// Processes an [Instruction](enum.Instruction.html).
208-
#[cfg(feature = "token-group")]
209208
pub fn process_instruction(
210209
program_id: &Pubkey,
211210
accounts: &[AccountInfo],
@@ -230,13 +229,3 @@ pub fn process_instruction(
230229
}
231230
}
232231
}
233-
234-
/// Processes an [Instruction](enum.Instruction.html).
235-
#[cfg(not(feature = "token-group"))]
236-
pub fn process_instruction(
237-
_program_id: &Pubkey,
238-
_accounts: &[AccountInfo],
239-
_instruction: TokenGroupInstruction,
240-
) -> ProgramResult {
241-
Err(TokenError::InvalidInstruction.into())
242-
}

0 commit comments

Comments
 (0)