(
_program_id: &Pubkey,
accounts: &'a [AccountInfo<'b>],
)
| 37 | |
| 38 | impl<'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 | |
| 59 | pub(crate) fn process(program_id: &Pubkey, accounts: &[AccountInfo]) -> ProgramResult { |
nothing calls this directly
no test coverage detected