@@ -2573,8 +2573,8 @@ fn slashing_performed_according_exposure() {
2573
2573
// Handle an offence with a historical exposure.
2574
2574
on_offence_now ( & [ offence_from ( 11 , None ) ] , & [ Perbill :: from_percent ( 50 ) ] ) ;
2575
2575
2576
- // The stash account should be slashed for 250 (50% of 500 ).
2577
- assert_eq ! ( asset:: stakeable_balance:: <Test >( & 11 ) , 1000 - 250 ) ;
2576
+ // The stash account should be slashed for 500 (50% of 1000 ).
2577
+ assert_eq ! ( asset:: stakeable_balance:: <Test >( & 11 ) , 500 ) ;
2578
2578
} ) ;
2579
2579
}
2580
2580
@@ -2660,14 +2660,14 @@ fn subsequent_reports_in_same_span_pay_out_less() {
2660
2660
2661
2661
assert_eq ! ( Staking :: eras_stakers( active_era( ) , & 11 ) . total, initial_balance) ;
2662
2662
2663
- on_offence_now ( & [ offence_from ( 11 , None ) ] , & [ Perbill :: from_percent ( 20 ) ] ) ;
2663
+ on_offence_now ( & [ offence_from ( 11 , Some ( vec ! [ 1 ] ) ) ] , & [ Perbill :: from_percent ( 20 ) ] ) ;
2664
2664
2665
2665
// F1 * (reward_proportion * slash - 0)
2666
2666
// 50% * (10% * initial_balance * 20%)
2667
2667
let reward = ( initial_balance / 5 ) / 20 ;
2668
2668
assert_eq ! ( asset:: total_balance:: <Test >( & 1 ) , 10 + reward) ;
2669
2669
2670
- on_offence_now ( & [ offence_from ( 11 , None ) ] , & [ Perbill :: from_percent ( 50 ) ] ) ;
2670
+ on_offence_now ( & [ offence_from ( 11 , Some ( vec ! [ 1 ] ) ) ] , & [ Perbill :: from_percent ( 50 ) ] ) ;
2671
2671
2672
2672
let prior_payout = reward;
2673
2673
@@ -4669,10 +4669,12 @@ fn offences_weight_calculated_correctly() {
4669
4669
zero_offence_weight
4670
4670
) ;
4671
4671
4672
- // On Offence with N offenders, Unapplied: 4 Reads, 1 Write + 4 Reads, 5 Writes
4672
+ // On Offence with N offenders, Unapplied: 4 Reads, 1 Write + 4 Reads, 5 Writes, 2 Reads + 2
4673
+ // Writes for `SessionInterface::report_offence` call.
4673
4674
let n_offence_unapplied_weight = <Test as frame_system:: Config >:: DbWeight :: get ( )
4674
4675
. reads_writes ( 4 , 1 ) +
4675
- <Test as frame_system:: Config >:: DbWeight :: get ( ) . reads_writes ( 4 , 5 ) ;
4676
+ <Test as frame_system:: Config >:: DbWeight :: get ( ) . reads_writes ( 4 , 5 ) +
4677
+ <Test as frame_system:: Config >:: DbWeight :: get ( ) . reads_writes ( 2 , 2 ) ;
4676
4678
4677
4679
let offenders: Vec <
4678
4680
OffenceDetails <
@@ -4709,7 +4711,8 @@ fn offences_weight_calculated_correctly() {
4709
4711
+ <Test as frame_system:: Config >:: DbWeight :: get ( ) . reads_writes ( 6 , 5 )
4710
4712
// `reward_cost` * reporters (1)
4711
4713
+ <Test as frame_system:: Config >:: DbWeight :: get ( ) . reads_writes ( 2 , 2 )
4712
- ;
4714
+ // `SessionInterface::report_offence`
4715
+ + <Test as frame_system:: Config >:: DbWeight :: get ( ) . reads_writes ( 2 , 2 ) ;
4713
4716
4714
4717
assert_eq ! (
4715
4718
<Staking as OnOffenceHandler <_, _, _>>:: on_offence(
0 commit comments