mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 07:31:02 +00:00
offences: make fn slash_fraction non-static (#11956)
* offences: make fn slash_fraction non-static * Bastifmt (inline variable)
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user