offences: make fn slash_fraction non-static (#11956)

* offences: make fn slash_fraction non-static

* Bastifmt (inline variable)
This commit is contained in:
Andronik
2022-08-02 20:49:03 +02:00
committed by GitHub
parent 63f847c24f
commit 0cda69d34a
8 changed files with 21 additions and 23 deletions
@@ -288,15 +288,13 @@ benchmarks! {
let (offenders, raw_offenders) = make_offenders_im_online::<T>(o, n)?;
let keys = ImOnline::<T>::keys();
let validator_set_count = keys.len() as u32;
let slash_fraction = UnresponsivenessOffence::<T::AccountId>::slash_fraction(
offenders.len() as u32, validator_set_count,
);
let offenders_count = offenders.len() as u32;
let offence = UnresponsivenessOffence {
session_index: 0,
validator_set_count,
offenders,
};
let slash_fraction = offence.slash_fraction(offenders_count);
assert_eq!(System::<T>::event_count(), 0);
}: {
let _ = <T as ImOnlineConfig>::ReportUnresponsiveness::report_offence(