@@ -288,7 +288,11 @@ fn inflation_recalculation_works() {
288288 new_config. recalculation_era,
289289 now + <Test as Config >:: CycleConfiguration :: eras_per_cycle( )
290290 ) ;
291- assert_eq ! ( new_config. decay_factor, Perquintill :: one( ) , "Default decay factor expected." ) ;
291+ assert_eq ! (
292+ new_config. decay_factor,
293+ Perquintill :: one( ) ,
294+ "Default decay factor expected."
295+ ) ;
292296
293297 // Verify collator rewards are as expected
294298 assert ! (
@@ -550,7 +554,10 @@ fn on_initialize_decay_and_payout_works() {
550554fn set_decay_factor_works ( ) {
551555 ExternalityBuilder :: build ( ) . execute_with ( || {
552556 // Sanity Check
553- assert_eq ! ( ActiveInflationConfig :: <Test >:: get( ) . decay_factor, Perquintill :: one( ) ) ;
557+ assert_eq ! (
558+ ActiveInflationConfig :: <Test >:: get( ) . decay_factor,
559+ Perquintill :: one( )
560+ ) ;
554561
555562 assert_noop ! (
556563 Inflation :: force_set_decay_factor( RuntimeOrigin :: signed( 1 ) , Perquintill :: one( ) ) ,
@@ -562,8 +569,16 @@ fn set_decay_factor_works() {
562569 RuntimeOrigin :: root( ) ,
563570 new_decay_factor
564571 ) ) ;
565- System :: assert_last_event ( Event :: DecayFactorUpdated { decay_factor : new_decay_factor } . into ( ) ) ;
566- assert_eq ! ( ActiveInflationConfig :: <Test >:: get( ) . decay_factor, new_decay_factor) ;
572+ System :: assert_last_event (
573+ Event :: DecayFactorUpdated {
574+ decay_factor : new_decay_factor,
575+ }
576+ . into ( ) ,
577+ ) ;
578+ assert_eq ! (
579+ ActiveInflationConfig :: <Test >:: get( ) . decay_factor,
580+ new_decay_factor
581+ ) ;
567582 } )
568583}
569584
@@ -595,26 +610,23 @@ fn force_readjust_config_with_decay_works() {
595610 let new_max_emission_from_config = new_config. collator_reward_per_block
596611 * Balance :: from ( <Test as Config >:: CycleConfiguration :: blocks_per_cycle ( ) )
597612 + new_config. treasury_reward_per_block
598- * Balance :: from ( <Test as Config >:: CycleConfiguration :: blocks_per_cycle ( ) )
613+ * Balance :: from ( <Test as Config >:: CycleConfiguration :: blocks_per_cycle ( ) )
599614 + new_config. dapp_reward_pool_per_era
600- * Balance :: from (
601- <Test as Config >:: CycleConfiguration :: build_and_earn_eras_per_cycle ( ) ,
602- )
615+ * Balance :: from (
616+ <Test as Config >:: CycleConfiguration :: build_and_earn_eras_per_cycle ( ) ,
617+ )
603618 + new_config. base_staker_reward_pool_per_era
604- * Balance :: from (
605- <Test as Config >:: CycleConfiguration :: build_and_earn_eras_per_cycle ( ) ,
606- )
619+ * Balance :: from (
620+ <Test as Config >:: CycleConfiguration :: build_and_earn_eras_per_cycle ( ) ,
621+ )
607622 + new_config. adjustable_staker_reward_pool_per_era
608- * Balance :: from (
609- <Test as Config >:: CycleConfiguration :: build_and_earn_eras_per_cycle ( ) ,
610- )
623+ * Balance :: from (
624+ <Test as Config >:: CycleConfiguration :: build_and_earn_eras_per_cycle ( ) ,
625+ )
611626 + new_config. bonus_reward_pool_per_period
612- * Balance :: from ( <Test as Config >:: CycleConfiguration :: periods_per_cycle ( ) ) ;
627+ * Balance :: from ( <Test as Config >:: CycleConfiguration :: periods_per_cycle ( ) ) ;
613628
614- lenient_balance_assert_eq ! (
615- original_max_emission,
616- new_max_emission_from_config
617- ) ;
629+ lenient_balance_assert_eq ! ( original_max_emission, new_max_emission_from_config) ;
618630 } )
619631}
620632
@@ -665,8 +677,14 @@ fn force_update_decay_rate_and_reset_factor_works() {
665677
666678 // Check updates
667679 let cfg_after = ActiveInflationConfig :: < Test > :: get ( ) ;
668- assert_eq ! ( cfg_after. decay_rate, new_decay_rate, "Decay rate should be reset to default" ) ;
669- assert_eq ! ( cfg_after. decay_factor, new_decay_factor, "Decay factor should be updated" ) ;
680+ assert_eq ! (
681+ cfg_after. decay_rate, new_decay_rate,
682+ "Decay rate should be reset to default"
683+ ) ;
684+ assert_eq ! (
685+ cfg_after. decay_factor, new_decay_factor,
686+ "Decay factor should be updated"
687+ ) ;
670688
671689 let issuance_before = Balances :: total_issuance ( ) ;
672690 Inflation :: on_initialize ( 1 ) ;
@@ -675,4 +693,3 @@ fn force_update_decay_rate_and_reset_factor_works() {
675693 lenient_balance_assert_eq ! ( issuance_now, issuance_before + total_expected_payout) ;
676694 } ) ;
677695}
678-
0 commit comments