MCPcopy Create free account
hub / github.com/Bonfida/dex-v4 / parse

Method parse

program/src/processor/close_account.rs:39–56  ·  view source on GitHub ↗
(
        _program_id: &Pubkey,
        accounts: &'a [AccountInfo<'b>],
    )

Source from the content-addressed store, hash-verified

37
38impl<'a, 'b: 'a> Accounts<'a, AccountInfo<'b>> {
39 pub fn parse(
40 _program_id: &Pubkey,
41 accounts: &'a [AccountInfo<'b>],
42 ) -> Result<Self, ProgramError> {
43 let accounts_iter = &mut accounts.iter();
44 let a = Self {
45 user: next_account_info(accounts_iter)?,
46 user_owner: next_account_info(accounts_iter)?,
47 target_lamports_account: next_account_info(accounts_iter)?,
48 };
49 check_signer(a.user_owner).map_err(|e| {
50 msg!("The user account owner should be a signer for this transaction!");
51 e
52 })?;
53 check_account_owner(a.user, _program_id, DexError::InvalidStateAccountOwner)?;
54
55 Ok(a)
56 }
57}
58
59pub(crate) fn process(program_id: &Pubkey, accounts: &[AccountInfo]) -> ProgramResult {

Callers

nothing calls this directly

Calls 2

check_signerFunction · 0.85
check_account_ownerFunction · 0.85

Tested by

no test coverage detected