This repository was archived by the owner on Nov 15, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ impl<Offender: Clone> Offence<Offender> for EquivocationOffence<Offender> {
8888 }
8989
9090 // The formula is min((3k / n)^2, 1)
91- // with: k = offenders_number, n = validators_number
91+ // where k = offenders_number and n = validators_number
9292 fn slash_fraction ( & self , offenders_count : u32 ) -> Perbill {
9393 // Perbill type domain is [0, 1] by definition
9494 Perbill :: from_rational ( 3 * offenders_count, self . validator_set_count ) . square ( )
Original file line number Diff line number Diff line change @@ -97,11 +97,11 @@ impl<Offender: Clone> Offence<Offender> for EquivocationOffence<Offender> {
9797 self . time_slot
9898 }
9999
100+ // The formula is min((3k / n)^2, 1)
101+ // where k = offenders_number and n = validators_number
100102 fn slash_fraction ( & self , offenders_count : u32 ) -> Perbill {
101- // the formula is min((3k / n)^2, 1)
102- let x = Perbill :: from_rational ( 3 * offenders_count, self . validator_set_count ) ;
103- // _ ^ 2
104- x. square ( )
103+ // Perbill type domain is [0, 1] by definition
104+ Perbill :: from_rational ( 3 * offenders_count, self . validator_set_count ) . square ( )
105105 }
106106}
107107
You can’t perform that action at this time.
0 commit comments