File tree 1 file changed +3
-5
lines changed
substrate/frame/staking/src
1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -1156,12 +1156,8 @@ mod benchmarks {
1156
1156
1157
1157
#[ benchmark]
1158
1158
fn manual_slash ( ) -> Result < ( ) , BenchmarkError > {
1159
- let era = EraIndex :: zero ( ) ;
1160
- CurrentEra :: < T > :: put ( era) ;
1161
- ErasStartSessionIndex :: < T > :: insert ( era, 0 ) ;
1162
- ActiveEra :: < T > :: put ( ActiveEraInfo { index : era, start : None } ) ;
1163
-
1164
1159
// Create a validator with nominators
1160
+ // This will add exposure for our validator in the current era.
1165
1161
let ( validator_stash, _nominators) = create_validator_with_nominators :: < T > (
1166
1162
T :: MaxExposurePageSize :: get ( ) as u32 ,
1167
1163
T :: MaxExposurePageSize :: get ( ) as u32 ,
@@ -1170,6 +1166,8 @@ mod benchmarks {
1170
1166
RewardDestination :: Staked ,
1171
1167
) ?;
1172
1168
1169
+ let era = CurrentEra :: < T > :: get ( ) . unwrap ( ) ;
1170
+ ActiveEra :: < T > :: put ( ActiveEraInfo { index : era, start : None } ) ;
1173
1171
let slash_fraction = Perbill :: from_percent ( 10 ) ;
1174
1172
1175
1173
#[ extrinsic_call]
You can’t perform that action at this time.
0 commit comments