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

Method parse

program/src/processor/cancel_order.rs:73–95  ·  view source on GitHub ↗
(
        program_id: &Pubkey,
        accounts: &'a [AccountInfo<'b>],
    )

Source from the content-addressed store, hash-verified

71
72impl<'a, 'b: 'a> Accounts<'a, AccountInfo<'b>> {
73 pub fn parse(
74 program_id: &Pubkey,
75 accounts: &'a [AccountInfo<'b>],
76 ) -> Result<Self, ProgramError> {
77 let accounts_iter = &mut accounts.iter();
78 let a = Self {
79 market: next_account_info(accounts_iter)?,
80 orderbook: next_account_info(accounts_iter)?,
81 event_queue: next_account_info(accounts_iter)?,
82 bids: next_account_info(accounts_iter)?,
83 asks: next_account_info(accounts_iter)?,
84 user: next_account_info(accounts_iter)?,
85 user_owner: next_account_info(accounts_iter)?,
86 };
87 check_signer(a.user_owner).map_err(|e| {
88 msg!("The user account owner should be a signer for this transaction!");
89 e
90 })?;
91 check_account_owner(a.market, program_id, DexError::InvalidStateAccountOwner)?;
92 check_account_owner(a.user, program_id, DexError::InvalidStateAccountOwner)?;
93
94 Ok(a)
95 }
96
97 pub fn load_user_account(
98 &self,

Callers

nothing calls this directly

Calls 2

check_signerFunction · 0.85
check_account_ownerFunction · 0.85

Tested by

no test coverage detected