Fix the stub round robin

At some point, the modulus was removed causing it to exceed the 
validators list and stop proposing.
This commit is contained in:
Luke Parker
2022-10-27 08:49:36 -04:00
parent 5c08fa9701
commit f91c081f30

View File

@@ -178,6 +178,9 @@ where
// TODO
fn proposer(&self, number: BlockNumber, round: Round) -> u16 {
u16::try_from(number.0 + u64::from(round.0)).unwrap()
u16::try_from(
(number.0 + u64::from(round.0)) % u64::try_from(self.0.read().unwrap().lookup.len()).unwrap(),
)
.unwrap()
}
}