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

Commit 51ece68

Browse files
author
Tyera Eulberg
authored
Add feature-wrapping for new ConfidentialTransferInstruction::TransferWithFee (#3116)
1 parent b3fe5b6 commit 51ece68

File tree

1 file changed

+14
-7
lines changed
  • token/program-2022/src/extension/confidential_transfer

1 file changed

+14
-7
lines changed

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

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,13 +1164,20 @@ pub(crate) fn process_instruction(
11641164
}
11651165
ConfidentialTransferInstruction::TransferWithFee => {
11661166
msg!("ConfidentialTransferInstruction::TransferWithFee");
1167-
let data = decode_instruction_data::<TransferWithFeeInstructionData>(input)?;
1168-
process_transfer(
1169-
program_id,
1170-
accounts,
1171-
data.new_source_decryptable_available_balance,
1172-
data.proof_instruction_offset as i64,
1173-
)
1167+
#[cfg(feature = "zk-ops")]
1168+
{
1169+
let data = decode_instruction_data::<TransferWithFeeInstructionData>(input)?;
1170+
process_transfer(
1171+
program_id,
1172+
accounts,
1173+
data.new_source_decryptable_available_balance,
1174+
data.proof_instruction_offset as i64,
1175+
)
1176+
}
1177+
#[cfg(not(feature = "zk-ops"))]
1178+
{
1179+
Err(ProgramError::InvalidInstructionData)
1180+
}
11741181
}
11751182
ConfidentialTransferInstruction::ApplyPendingBalance => {
11761183
msg!("ConfidentialTransferInstruction::ApplyPendingBalance");

0 commit comments

Comments
 (0)