Skip to content

Commit

Permalink
move WithdrawWithheldTokensFrom{Accounts,Mint} instructions into `z…
Browse files Browse the repository at this point in the history
…k-ops` feature
  • Loading branch information
samkim-crypto committed Aug 10, 2023
1 parent 286b8fb commit 2cb1575
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,11 @@ pub enum ConfidentialTransferFeeInstruction {
/// Accounts expected by this instruction:
///
/// * Single owner/delegate
/// 0. `[writable]` The SPL Token account.
/// 0. `[writable]` The token mint.
/// 1. `[signer]` The confidential transfer fee authority.
///
/// *Multisignature owner/delegate
/// 0. `[writable]` The SPL Token account.
/// 0. `[writable]` The token mint.
/// 1. `[]` The confidential transfer fee multisig authority,
/// 2. `[signer]` Required M signer accounts for the SPL Token Multisig account.
///
Expand All @@ -176,11 +176,11 @@ pub enum ConfidentialTransferFeeInstruction {
/// Accounts expected by this instruction:
///
/// * Single owner/delegate
/// 0. `[writable]` The SPL Token account.
/// 0. `[writable]` The token mint.
/// 1. `[signer]` The confidential transfer fee authority.
///
/// *Multisignature owner/delegate
/// 0. `[writable]` The SPL Token account.
/// 0. `[writable]` The token mint.
/// 1. `[]` The confidential transfer fee multisig authority,
/// 2. `[signer]` Required M signer accounts for the SPL Token Multisig account.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -469,24 +469,31 @@ pub(crate) fn process_instruction(
}
ConfidentialTransferFeeInstruction::WithdrawWithheldTokensFromMint => {
msg!("ConfidentialTransferFeeInstruction::WithdrawWithheldTokensFromMint");
let data = decode_instruction_data::<WithdrawWithheldTokensFromMintData>(input)?;
process_withdraw_withheld_tokens_from_mint(
program_id,
accounts,
&data.new_decryptable_available_balance,
data.proof_instruction_offset as i64,
)
#[cfg(feature = "zk-ops")]
{
let data = decode_instruction_data::<WithdrawWithheldTokensFromMintData>(input)?;
process_withdraw_withheld_tokens_from_mint(
program_id,
accounts,
&data.new_decryptable_available_balance,
data.proof_instruction_offset as i64,
)
}
}
ConfidentialTransferFeeInstruction::WithdrawWithheldTokensFromAccounts => {
msg!("ConfidentialTransferFeeInstruction::WithdrawWithheldTokensFromAccounts");
let data = decode_instruction_data::<WithdrawWithheldTokensFromAccountsData>(input)?;
process_withdraw_withheld_tokens_from_accounts(
program_id,
accounts,
data.num_token_accounts,
&data.new_decryptable_available_balance,
data.proof_instruction_offset as i64,
)
#[cfg(feature = "zk-ops")]
{
let data =
decode_instruction_data::<WithdrawWithheldTokensFromAccountsData>(input)?;
process_withdraw_withheld_tokens_from_accounts(
program_id,
accounts,
data.num_token_accounts,
&data.new_decryptable_available_balance,
data.proof_instruction_offset as i64,
)
}
}
ConfidentialTransferFeeInstruction::HarvestWithheldTokensToMint => {
msg!("ConfidentialTransferFeeInstruction::HarvestWithheldTokensToMint");
Expand Down

0 comments on commit 2cb1575

Please sign in to comment.