Skip to content

Commit

Permalink
remove transfer hook from deprecate transfer branch
Browse files Browse the repository at this point in the history
  • Loading branch information
buffalojoec committed Jan 11, 2024
1 parent 9c32123 commit 1358800
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions token/client/src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -950,34 +950,14 @@ where
}
} else {
#[allow(deprecated)]
let mut instruction = instruction::transfer(
instruction::transfer(
&self.program_id,
source,
destination,
authority,
&multisig_signers,
amount,
)?;
if let Some(transfer_hook_accounts) = &self.transfer_hook_accounts {
instruction.accounts.extend(transfer_hook_accounts.clone());
} else {
let mint = self.get_mint_info().await?;
if let Some(program_id) = transfer_hook::get_program_id(&mint) {
spl_transfer_hook_interface::offchain::add_extra_account_metas_for_execute(
&mut instruction,
&program_id,
source,
self.get_address(),
destination,
authority,
amount,
fetch_account_data_fn,
)
.await
.map_err(|_| TokenError::AccountNotFound)?;
}
};
instruction
)?
};

self.process_ixs(&[instruction], signing_keypairs).await
Expand Down

0 comments on commit 1358800

Please sign in to comment.