mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-11 21:49:26 +00:00
Refactor <V, B> to type V, type B
This commit is contained in:
@@ -3,12 +3,6 @@ use ext::*;
|
||||
|
||||
mod message_log;
|
||||
|
||||
// Type aliases which are distinct according to the type system
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
|
||||
pub(crate) struct BlockNumber(u32);
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
|
||||
pub(crate) struct Round(u32);
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
|
||||
enum Step {
|
||||
Propose,
|
||||
@@ -58,13 +52,6 @@ use tokio::{
|
||||
sync::mpsc,
|
||||
};
|
||||
|
||||
type ValidatorId = u16;
|
||||
const VALIDATORS: ValidatorId = 5;
|
||||
|
||||
fn proposer(number: u32, round: u32) -> ValidatorId {
|
||||
ValidatorId::try_from((number + round) % u32::try_from(VALIDATORS).unwrap()).unwrap()
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
struct TendermintMachine {
|
||||
proposer: ValidatorId,
|
||||
|
||||
Reference in New Issue
Block a user