Skip to content

Commit

Permalink
added check_account_infos util
Browse files Browse the repository at this point in the history
  • Loading branch information
buffalojoec committed Aug 15, 2023
1 parent 2b93141 commit ab34a86
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions token/transfer-hook-example/src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,6 @@ fn check_token_account_is_transferring(account_info: &AccountInfo) -> Result<(),
}
}

fn check_extra_meta(
account_info: &AccountInfo,
extra_meta: &AccountMeta,
) -> Result<(), ProgramError> {
if !(&extra_meta.pubkey == account_info.key
&& extra_meta.is_signer == account_info.is_signer
&& extra_meta.is_writable == account_info.is_writable)
{
return Err(TransferHookError::IncorrectAccount.into());
}
Ok(())
}

fn next_extra_account_meta<'a>(
extra_account_metas_iter: &mut impl Iterator<Item = &'a ExtraAccountMeta>,
) -> Result<&'a ExtraAccountMeta, ProgramError> {
extra_account_metas_iter
.next()
.ok_or(ProgramError::NotEnoughAccountKeys)
}

/// Processes an [Execute](enum.TransferHookInstruction.html) instruction.
pub fn process_execute(
program_id: &Pubkey,
Expand Down

0 comments on commit ab34a86

Please sign in to comment.