(
program_id: &Pubkey,
accounts: &'a [AccountInfo<'b>],
)
| 75 | |
| 76 | impl<'a, 'b: 'a> Accounts<'a, AccountInfo<'b>> { |
| 77 | pub fn parse( |
| 78 | program_id: &Pubkey, |
| 79 | accounts: &'a [AccountInfo<'b>], |
| 80 | ) -> Result<Self, ProgramError> { |
| 81 | let accounts_iter = &mut accounts.iter(); |
| 82 | |
| 83 | let a = Self { |
| 84 | market: next_account_info(accounts_iter)?, |
| 85 | orderbook: next_account_info(accounts_iter)?, |
| 86 | base_vault: next_account_info(accounts_iter)?, |
| 87 | quote_vault: next_account_info(accounts_iter)?, |
| 88 | market_admin: next_account_info(accounts_iter)?, |
| 89 | event_queue: next_account_info(accounts_iter)?, |
| 90 | asks: next_account_info(accounts_iter)?, |
| 91 | bids: next_account_info(accounts_iter)?, |
| 92 | token_metadata: next_account_info(accounts_iter)?, |
| 93 | }; |
| 94 | |
| 95 | check_account_owner(a.market, program_id, DexError::InvalidStateAccountOwner)?; |
| 96 | check_account_owner(a.orderbook, program_id, DexError::InvalidStateAccountOwner)?; |
| 97 | check_account_owner( |
| 98 | a.base_vault, |
| 99 | &spl_token::ID, |
| 100 | DexError::InvalidStateAccountOwner, |
| 101 | )?; |
| 102 | check_account_owner( |
| 103 | a.quote_vault, |
| 104 | &spl_token::ID, |
| 105 | DexError::InvalidStateAccountOwner, |
| 106 | )?; |
| 107 | |
| 108 | Ok(a) |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | pub(crate) fn process( |
nothing calls this directly
no test coverage detected