mirror of
https://github.com/serai-dex/serai.git
synced 2025-01-03 17:40:34 +00:00
Correct 2/3rds definitions throughout the codebase
The prior formula failed for some values, such as 20. 20 / 3 = 6, * 2 = 12, + 1 = 13. 13 is 65%, not >= 67.
This commit is contained in:
parent
ffea02dfbf
commit
89974c529a
2 changed files with 2 additions and 2 deletions
|
@ -88,7 +88,7 @@ impl TributarySpec {
|
|||
}
|
||||
|
||||
pub fn t(&self) -> u16 {
|
||||
(2 * (self.n() / 3)) + 1
|
||||
((2 * self.n()) / 3) + 1
|
||||
}
|
||||
|
||||
pub fn i(&self, key: <Ristretto as Ciphersuite>::G) -> Option<Participant> {
|
||||
|
|
|
@ -22,7 +22,7 @@ use promote::test_generator_promotion;
|
|||
/// Constant amount of participants to use when testing.
|
||||
pub const PARTICIPANTS: u16 = 5;
|
||||
/// Constant threshold of participants to use when testing.
|
||||
pub const THRESHOLD: u16 = ((PARTICIPANTS / 3) * 2) + 1;
|
||||
pub const THRESHOLD: u16 = ((PARTICIPANTS * 2) / 3) + 1;
|
||||
|
||||
/// Clone a map without a specific value.
|
||||
pub fn clone_without<K: Clone + std::cmp::Eq + std::hash::Hash, V: Clone>(
|
||||
|
|
Loading…
Reference in a new issue