11#[ cfg( feature = "zk-ops" ) ]
2- use spl_token_confidential_transfer_ciphertext_arithmetic as ciphertext_arithmetic;
32use {
43 crate :: {
5- check_auditor_ciphertext, check_program_account,
4+ check_auditor_ciphertext,
5+ extension:: confidential_mint_burn:: verify_proof:: { verify_burn_proof, verify_mint_proof} ,
6+ } ,
7+ spl_token_confidential_transfer_ciphertext_arithmetic as ciphertext_arithmetic,
8+ } ;
9+ use {
10+ crate :: {
11+ check_program_account,
612 error:: TokenError ,
713 extension:: {
814 confidential_mint_burn:: {
1117 MintInstructionData , RotateSupplyElGamalPubkeyData ,
1218 UpdateDecryptableSupplyData ,
1319 } ,
14- verify_proof:: { verify_burn_proof, verify_mint_proof} ,
1520 ConfidentialMintBurn ,
1621 } ,
1722 confidential_transfer:: { ConfidentialTransferAccount , ConfidentialTransferMint } ,
@@ -418,6 +423,7 @@ fn process_confidential_burn(
418423}
419424
420425/// Processes a [`ApplyPendingBurn`] instruction.
426+ #[ cfg( feature = "zk-ops" ) ]
421427fn process_apply_pending_burn ( program_id : & Pubkey , accounts : & [ AccountInfo ] ) -> ProgramResult {
422428 let account_info_iter = & mut accounts. iter ( ) ;
423429 let mint_info = next_account_info ( account_info_iter) ?;
@@ -467,8 +473,13 @@ pub(crate) fn process_instruction(
467473 }
468474 ConfidentialMintBurnInstruction :: RotateSupplyElGamalPubkey => {
469475 msg ! ( "ConfidentialMintBurnInstruction::RotateSupplyElGamal" ) ;
470- let data = decode_instruction_data :: < RotateSupplyElGamalPubkeyData > ( input) ?;
471- process_rotate_supply_elgamal_pubkey ( program_id, accounts, data)
476+ #[ cfg( feature = "zk-ops" ) ]
477+ {
478+ let data = decode_instruction_data :: < RotateSupplyElGamalPubkeyData > ( input) ?;
479+ process_rotate_supply_elgamal_pubkey ( program_id, accounts, data)
480+ }
481+ #[ cfg( not( feature = "zk-ops" ) ) ]
482+ Err ( ProgramError :: InvalidInstructionData )
472483 }
473484 ConfidentialMintBurnInstruction :: UpdateDecryptableSupply => {
474485 msg ! ( "ConfidentialMintBurnInstruction::UpdateDecryptableSupply" ) ;
@@ -477,17 +488,32 @@ pub(crate) fn process_instruction(
477488 }
478489 ConfidentialMintBurnInstruction :: Mint => {
479490 msg ! ( "ConfidentialMintBurnInstruction::ConfidentialMint" ) ;
480- let data = decode_instruction_data :: < MintInstructionData > ( input) ?;
481- process_confidential_mint ( program_id, accounts, data)
491+ #[ cfg( feature = "zk-ops" ) ]
492+ {
493+ let data = decode_instruction_data :: < MintInstructionData > ( input) ?;
494+ process_confidential_mint ( program_id, accounts, data)
495+ }
496+ #[ cfg( not( feature = "zk-ops" ) ) ]
497+ Err ( ProgramError :: InvalidInstructionData )
482498 }
483499 ConfidentialMintBurnInstruction :: Burn => {
484500 msg ! ( "ConfidentialMintBurnInstruction::ConfidentialBurn" ) ;
485- let data = decode_instruction_data :: < BurnInstructionData > ( input) ?;
486- process_confidential_burn ( program_id, accounts, data)
501+ #[ cfg( feature = "zk-ops" ) ]
502+ {
503+ let data = decode_instruction_data :: < BurnInstructionData > ( input) ?;
504+ process_confidential_burn ( program_id, accounts, data)
505+ }
506+ #[ cfg( not( feature = "zk-ops" ) ) ]
507+ Err ( ProgramError :: InvalidInstructionData )
487508 }
488509 ConfidentialMintBurnInstruction :: ApplyPendingBurn => {
489510 msg ! ( "ConfidentialMintBurnInstruction::ApplyPendingBurn" ) ;
490- process_apply_pending_burn ( program_id, accounts)
511+ #[ cfg( feature = "zk-ops" ) ]
512+ {
513+ process_apply_pending_burn ( program_id, accounts)
514+ }
515+ #[ cfg( not( feature = "zk-ops" ) ) ]
516+ Err ( ProgramError :: InvalidInstructionData )
491517 }
492518 }
493519}
0 commit comments