(
program_id: &Pubkey,
accounts: &'a [AccountInfo<'b>],
)
| 71 | |
| 72 | impl<'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, |
nothing calls this directly
no test coverage detected