|
10 | 10 | }, |
11 | 11 | instruction::CommandHeader, |
12 | 12 | utils::{ |
| 13 | + check_permissioned_funding_account, |
13 | 14 | check_valid_funding_account, |
14 | | - check_valid_signable_account_or_permissioned_funding_account, |
15 | 15 | pyth_assert, |
16 | 16 | try_convert, |
17 | 17 | }, |
@@ -44,29 +44,27 @@ pub fn del_product( |
44 | 44 | accounts: &[AccountInfo], |
45 | 45 | instruction_data: &[u8], |
46 | 46 | ) -> ProgramResult { |
47 | | - let (funding_account, mapping_account, product_account, permissions_account_option) = |
48 | | - match accounts { |
49 | | - [w, x, y] => Ok((w, x, y, None)), |
50 | | - [w, x, y, p] => Ok((w, x, y, Some(p))), |
51 | | - _ => Err(OracleError::InvalidNumberOfAccounts), |
52 | | - }?; |
| 47 | + let (funding_account, mapping_account, product_account, permissions_account) = match accounts { |
| 48 | + [w, x, y, p] => Ok((w, x, y, p)), |
| 49 | + _ => Err(OracleError::InvalidNumberOfAccounts), |
| 50 | + }?; |
53 | 51 |
|
54 | 52 | let cmd_args = load::<CommandHeader>(instruction_data)?; |
55 | 53 |
|
56 | 54 | check_valid_funding_account(funding_account)?; |
57 | | - check_valid_signable_account_or_permissioned_funding_account( |
| 55 | + check_permissioned_funding_account( |
58 | 56 | program_id, |
59 | 57 | mapping_account, |
60 | 58 | funding_account, |
61 | | - permissions_account_option, |
| 59 | + permissions_account, |
62 | 60 | cmd_args, |
63 | 61 | )?; |
64 | 62 |
|
65 | | - check_valid_signable_account_or_permissioned_funding_account( |
| 63 | + check_permissioned_funding_account( |
66 | 64 | program_id, |
67 | 65 | product_account, |
68 | 66 | funding_account, |
69 | | - permissions_account_option, |
| 67 | + permissions_account, |
70 | 68 | cmd_args, |
71 | 69 | )?; |
72 | 70 |
|
|
0 commit comments