Skip to content
Merged
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
6 changes: 5 additions & 1 deletion program/src/instructions/deposit/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ use crate::{
events::DepositEvent,
instructions::Deposit,
state::{
get_extensions_from_account, AllowedMint, AllowedMintPda, Escrow, ExtensionType, HookData, HookPoint, Receipt,
get_extensions_from_account, validate_extensions_pda, AllowedMint, AllowedMintPda, Escrow, ExtensionType,
HookData, HookPoint, Receipt,
},
traits::{AccountSerialize, AccountSize, EventSerialize, ExtensionData, PdaSeeds},
utils::{create_pda_account, emit_event, get_mint_decimals},
Expand Down Expand Up @@ -70,6 +71,9 @@ pub fn process_deposit(program_id: &Address, accounts: &[AccountView], instructi
receipt.write_to_slice(&mut receipt_data_slice)?;
drop(receipt_data_slice);

// Validate extensions PDA
validate_extensions_pda(ix.accounts.escrow, ix.accounts.extensions, program_id)?;

// Get hook extension if present
let exts = get_extensions_from_account(ix.accounts.extensions, &[ExtensionType::Hook])?;
let hook_data = exts[0].as_ref().map(|b| HookData::from_bytes(b)).transpose()?;
Expand Down