Skip to content

p-token: Tweaks to processors #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions p-token/src/entrypoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,34 @@ pub(crate) fn inner_process_instruction(

process_mint_to(accounts, instruction_data)
}
// 8 - Burn
8 => {
#[cfg(feature = "logging")]
pinocchio::msg!("Instruction: Burn");

process_burn(accounts, instruction_data)
}
// 9 - CloseAccount
9 => {
#[cfg(feature = "logging")]
pinocchio::msg!("Instruction: CloseAccount");

process_close_account(accounts)
}
// 12 - TransferChecked
12 => {
#[cfg(feature = "logging")]
pinocchio::msg!("Instruction: TransferChecked");

process_transfer_checked(accounts, instruction_data)
}
// 15 - BurnChecked
15 => {
#[cfg(feature = "logging")]
pinocchio::msg!("Instruction: BurnChecked");

process_burn_checked(accounts, instruction_data)
}
// 16 - InitializeAccount2
16 => {
#[cfg(feature = "logging")]
Expand Down Expand Up @@ -182,13 +203,6 @@ fn inner_process_remaining_instruction(

process_set_authority(accounts, instruction_data)
}
// 8 - Burn
8 => {
#[cfg(feature = "logging")]
pinocchio::msg!("Instruction: Burn");

process_burn(accounts, instruction_data)
}
// 10 - FreezeAccount
10 => {
#[cfg(feature = "logging")]
Expand All @@ -203,13 +217,6 @@ fn inner_process_remaining_instruction(

process_thaw_account(accounts)
}
// 12 - TransferChecked
12 => {
#[cfg(feature = "logging")]
pinocchio::msg!("Instruction: TransferChecked");

process_transfer_checked(accounts, instruction_data)
}
// 13 - ApproveChecked
13 => {
#[cfg(feature = "logging")]
Expand All @@ -224,13 +231,6 @@ fn inner_process_remaining_instruction(

process_mint_to_checked(accounts, instruction_data)
}
// 15 - BurnChecked
15 => {
#[cfg(feature = "logging")]
pinocchio::msg!("Instruction: BurnChecked");

process_burn_checked(accounts, instruction_data)
}
// 17 - SyncNative
17 => {
#[cfg(feature = "logging")]
Expand Down
1 change: 0 additions & 1 deletion p-token/src/processor/amount_to_ui_amount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use {
},
};

#[inline(always)]
pub fn process_amount_to_ui_amount(
accounts: &[AccountInfo],
instruction_data: &[u8],
Expand Down
1 change: 0 additions & 1 deletion p-token/src/processor/initialize_multisig2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use {
pinocchio::{account_info::AccountInfo, program_error::ProgramError, ProgramResult},
};

#[inline(always)]
pub fn process_initialize_multisig2(
accounts: &[AccountInfo],
instruction_data: &[u8],
Expand Down
1 change: 0 additions & 1 deletion p-token/src/processor/ui_amount_to_amount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use {
},
};

#[inline(always)]
pub fn process_ui_amount_to_amount(
accounts: &[AccountInfo],
instruction_data: &[u8],
Expand Down
1 change: 0 additions & 1 deletion p-token/src/processor/withdraw_excess_lamports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use {
},
};

#[inline(always)]
#[allow(clippy::arithmetic_side_effects)]
pub fn process_withdraw_excess_lamports(accounts: &[AccountInfo]) -> ProgramResult {
let [source_account_info, destination_info, authority_info, remaining @ ..] = accounts else {
Expand Down