3737// account[1] product account [writable]
3838// account[2] new price account [writable]
3939// account[3] permissions account [writable]
40- // account[4] system program account []
4140pub fn add_price (
4241 program_id : & Pubkey ,
4342 accounts : & [ AccountInfo ] ,
@@ -51,12 +50,10 @@ pub fn add_price(
5150 ProgramError :: InvalidArgument ,
5251 ) ?;
5352
54-
55- let ( funding_account, product_account, price_account, permissions_account, system_program) =
56- match accounts {
57- [ x, y, z, p, q] => Ok ( ( x, y, z, p, q) ) ,
58- _ => Err ( OracleError :: InvalidNumberOfAccounts ) ,
59- } ?;
53+ let ( funding_account, product_account, price_account, permissions_account) = match accounts {
54+ [ x, y, z, p] => Ok ( ( x, y, z, p) ) ,
55+ _ => Err ( OracleError :: InvalidNumberOfAccounts ) ,
56+ } ?;
6057
6158 check_valid_funding_account ( funding_account) ?;
6259 check_permissioned_funding_account (
@@ -74,10 +71,6 @@ pub fn add_price(
7471 & cmd_args. header ,
7572 ) ?;
7673 check_valid_writable_account ( program_id, permissions_account) ?;
77- pyth_assert (
78- solana_program:: system_program:: check_id ( system_program. key ) ,
79- OracleError :: InvalidSystemAccount . into ( ) ,
80- ) ?;
8174
8275 let mut product_data =
8376 load_checked :: < ProductAccount > ( product_account, cmd_args. header . version ) ?;
@@ -89,8 +82,7 @@ pub fn add_price(
8982 price_data. product_account = * product_account. key ;
9083 price_data. next_price_account = product_data. first_price_account ;
9184 price_data. min_pub_ = PRICE_ACCOUNT_DEFAULT_MIN_PUB ;
92- price_data. feed_index =
93- reserve_new_price_feed_index ( funding_account, permissions_account, system_program) ?;
85+ price_data. feed_index = reserve_new_price_feed_index ( permissions_account) ?;
9486 product_data. first_price_account = * price_account. key ;
9587
9688 Ok ( ( ) )
0 commit comments