(
_program_id: &Pubkey,
accounts: &'a [AccountInfo<'b>],
)
| 55 | |
| 56 | impl<'a, 'b: 'a> Accounts<'a, AccountInfo<'b>> { |
| 57 | pub fn parse( |
| 58 | _program_id: &Pubkey, |
| 59 | accounts: &'a [AccountInfo<'b>], |
| 60 | ) -> Result<Self, ProgramError> { |
| 61 | let accounts_iter = &mut accounts.iter(); |
| 62 | let a = Self { |
| 63 | system_program: next_account_info(accounts_iter)?, |
| 64 | user: next_account_info(accounts_iter)?, |
| 65 | user_owner: next_account_info(accounts_iter)?, |
| 66 | fee_payer: next_account_info(accounts_iter)?, |
| 67 | }; |
| 68 | check_signer(a.user_owner).map_err(|e| { |
| 69 | msg!("The user account owner should be a signer for this transaction!"); |
| 70 | e |
| 71 | })?; |
| 72 | check_account_key( |
| 73 | a.system_program, |
| 74 | &system_program::ID, |
| 75 | DexError::InvalidSystemProgramAccount, |
| 76 | )?; |
| 77 | check_account_owner( |
| 78 | a.user, |
| 79 | &system_program::ID, |
| 80 | DexError::InvalidStateAccountOwner, |
| 81 | )?; |
| 82 | |
| 83 | Ok(a) |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | pub(crate) fn process( |
nothing calls this directly
no test coverage detected