@@ -90,11 +90,12 @@ pub fn resize_price_account(
9090 accounts : & [ AccountInfo ] ,
9191 instruction_data : & [ u8 ] ,
9292) -> ProgramResult {
93- let ( funding_account, price_account, system_program, permissions_account_option) = match accounts {
94- [ x, y, z] => Ok ( ( x, y, z, None ) ) ,
95- [ x, y, z, p] => Ok ( ( x, y, z, Some ( p) ) ) ,
96- _ => Err ( OracleError :: InvalidNumberOfAccounts ) ,
97- } ?;
93+ let ( funding_account, price_account, system_program, permissions_account_option) =
94+ match accounts {
95+ [ x, y, z] => Ok ( ( x, y, z, None ) ) ,
96+ [ x, y, z, p] => Ok ( ( x, y, z, Some ( p) ) ) ,
97+ _ => Err ( OracleError :: InvalidNumberOfAccounts ) ,
98+ } ?;
9899
99100 let hdr = load :: < CommandHeader > ( instruction_data) ?;
100101
@@ -219,7 +220,7 @@ pub fn add_mapping(
219220 permissions_account_option,
220221 hdr,
221222 ) ?;
222-
223+
223224 let mut cur_mapping = load_checked :: < MappingAccount > ( cur_mapping, hdr. version ) ?;
224225 pyth_assert (
225226 cur_mapping. number_of_products == PC_MAP_TABLE_SIZE
@@ -367,11 +368,12 @@ pub fn add_price(
367368 ) ?;
368369
369370
370- let ( funding_account, product_account, price_account, permissions_account_option) = match accounts {
371- [ x, y, z] => Ok ( ( x, y, z, None ) ) ,
372- [ x, y, z, p] => Ok ( ( x, y, z, Some ( p) ) ) ,
373- _ => Err ( OracleError :: InvalidNumberOfAccounts ) ,
374- } ?;
371+ let ( funding_account, product_account, price_account, permissions_account_option) =
372+ match accounts {
373+ [ x, y, z] => Ok ( ( x, y, z, None ) ) ,
374+ [ x, y, z, p] => Ok ( ( x, y, z, Some ( p) ) ) ,
375+ _ => Err ( OracleError :: InvalidNumberOfAccounts ) ,
376+ } ?;
375377
376378 check_valid_funding_account ( funding_account) ?;
377379 check_valid_signable_account_or_permissioned_funding_account (
@@ -415,11 +417,12 @@ pub fn del_price(
415417 accounts : & [ AccountInfo ] ,
416418 instruction_data : & [ u8 ] ,
417419) -> ProgramResult {
418- let ( funding_account, product_account, price_account, permissions_account_option) = match accounts {
419- [ w, x, y] => Ok ( ( w, x, y, None ) ) ,
420- [ w, x, y, p] => Ok ( ( w, x, y, Some ( p) ) ) ,
421- _ => Err ( OracleError :: InvalidNumberOfAccounts ) ,
422- } ?;
420+ let ( funding_account, product_account, price_account, permissions_account_option) =
421+ match accounts {
422+ [ w, x, y] => Ok ( ( w, x, y, None ) ) ,
423+ [ w, x, y, p] => Ok ( ( w, x, y, Some ( p) ) ) ,
424+ _ => Err ( OracleError :: InvalidNumberOfAccounts ) ,
425+ } ?;
423426
424427 let cmd_args = load :: < CommandHeader > ( instruction_data) ?;
425428
@@ -429,18 +432,17 @@ pub fn del_price(
429432 product_account,
430433 funding_account,
431434 permissions_account_option,
432- & cmd_args,
435+ cmd_args,
433436 ) ?;
434437 check_valid_signable_account_or_permissioned_funding_account (
435438 program_id,
436439 price_account,
437440 funding_account,
438441 permissions_account_option,
439- & cmd_args,
442+ cmd_args,
440443 ) ?;
441444
442445 {
443-
444446 let mut product_data = load_checked :: < ProductAccount > ( product_account, cmd_args. version ) ?;
445447 let price_data = load_checked :: < PriceAccount > ( price_account, cmd_args. version ) ?;
446448 pyth_assert (
@@ -654,11 +656,12 @@ pub fn add_product(
654656 accounts : & [ AccountInfo ] ,
655657 instruction_data : & [ u8 ] ,
656658) -> ProgramResult {
657- let ( funding_account, tail_mapping_account, new_product_account, permissions_account_option) = match accounts {
658- [ x, y, z] => Ok ( ( x, y, z, None ) ) ,
659- [ x, y, z, p] => Ok ( ( x, y, z, Some ( p) ) ) ,
660- _ => Err ( OracleError :: InvalidNumberOfAccounts ) ,
661- } ?;
659+ let ( funding_account, tail_mapping_account, new_product_account, permissions_account_option) =
660+ match accounts {
661+ [ x, y, z] => Ok ( ( x, y, z, None ) ) ,
662+ [ x, y, z, p] => Ok ( ( x, y, z, Some ( p) ) ) ,
663+ _ => Err ( OracleError :: InvalidNumberOfAccounts ) ,
664+ } ?;
662665
663666 let hdr = load :: < CommandHeader > ( instruction_data) ?;
664667
@@ -668,17 +671,17 @@ pub fn add_product(
668671 tail_mapping_account,
669672 funding_account,
670673 permissions_account_option,
671- & hdr,
674+ hdr,
672675 ) ?;
673676 check_valid_signable_account_or_permissioned_funding_account (
674677 program_id,
675678 new_product_account,
676679 funding_account,
677680 permissions_account_option,
678- & hdr,
681+ hdr,
679682 ) ?;
680683
681-
684+
682685 let mut mapping_data = load_checked :: < MappingAccount > ( tail_mapping_account, hdr. version ) ?;
683686 // The mapping account must have free space to add the product account
684687 pyth_assert (
@@ -720,10 +723,10 @@ pub fn upd_product(
720723 product_account,
721724 funding_account,
722725 permissions_account_option,
723- & hdr,
726+ hdr,
724727 ) ?;
725728
726-
729+
727730 {
728731 // Validate that product_account contains the appropriate account header
729732 let mut _product_data = load_checked :: < ProductAccount > ( product_account, hdr. version ) ?;
@@ -814,11 +817,12 @@ pub fn del_product(
814817 accounts : & [ AccountInfo ] ,
815818 instruction_data : & [ u8 ] ,
816819) -> ProgramResult {
817- let ( funding_account, mapping_account, product_account, permissions_account_option) = match accounts {
818- [ w, x, y] => Ok ( ( w, x, y, None ) ) ,
819- [ w, x, y, p] => Ok ( ( w, x, y, Some ( p) ) ) ,
820- _ => Err ( OracleError :: InvalidNumberOfAccounts ) ,
821- } ?;
820+ let ( funding_account, mapping_account, product_account, permissions_account_option) =
821+ match accounts {
822+ [ w, x, y] => Ok ( ( w, x, y, None ) ) ,
823+ [ w, x, y, p] => Ok ( ( w, x, y, Some ( p) ) ) ,
824+ _ => Err ( OracleError :: InvalidNumberOfAccounts ) ,
825+ } ?;
822826
823827 let cmd_args = load :: < CommandHeader > ( instruction_data) ?;
824828
@@ -828,20 +832,19 @@ pub fn del_product(
828832 mapping_account,
829833 funding_account,
830834 permissions_account_option,
831- & cmd_args,
835+ cmd_args,
832836 ) ?;
833837
834838 check_valid_signable_account_or_permissioned_funding_account (
835839 program_id,
836840 product_account,
837841 funding_account,
838842 permissions_account_option,
839- & cmd_args,
843+ cmd_args,
840844 ) ?;
841845
842846
843847 {
844-
845848 let mut mapping_data = load_checked :: < MappingAccount > ( mapping_account, cmd_args. version ) ?;
846849 let product_data = load_checked :: < ProductAccount > ( product_account, cmd_args. version ) ?;
847850
0 commit comments