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
+2 -2
View File
@@ -353,9 +353,9 @@ impl<FullIdentification: Clone> Offence<FullIdentification>
self.time_slot
}
fn slash_fraction(offenders_count: u32, validator_set_count: u32) -> Perbill {
fn slash_fraction(&self, offenders_count: u32) -> Perbill {
// the formula is min((3k / n)^2, 1)
let x = Perbill::from_rational(3 * offenders_count, validator_set_count);
let x = Perbill::from_rational(3 * offenders_count, self.validator_set_count);
// _ ^ 2
x.square()
}