-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
81 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ resolver = "2" | |
|
||
members = [ | ||
"common", | ||
"consensus", | ||
"driver", | ||
"round", | ||
"vote", | ||
"test", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use malachite_common::Context; | ||
|
||
/// Client for use by the [`Driver`](crate::Driver) to ask | ||
/// for a value to propose and validate proposals. | ||
pub trait Client<Ctx> | ||
where | ||
Ctx: Context, | ||
{ | ||
/// Get the value to propose. | ||
fn get_value(&self) -> Ctx::Value; | ||
|
||
/// Validate a proposal. | ||
fn validate_proposal(&self, proposal: &Ctx::Proposal) -> bool; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
use malachite_common::{Context, Round, SignedVote, Timeout}; | ||
|
||
/// Events that can be received by the [`Driver`](crate::Driver). | ||
#[derive(Clone, Debug, PartialEq, Eq)] | ||
pub enum Event<Ctx> | ||
where | ||
Ctx: Context, | ||
{ | ||
NewRound(Round), | ||
Proposal(Ctx::Proposal), | ||
Vote(SignedVote<Ctx>), | ||
TimeoutElapsed(Timeout), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use malachite_common::{Context, Round, SignedVote, Timeout}; | ||
|
||
/// Messages emitted by the [`Driver`](crate::Driver) | ||
#[derive(Clone, Debug, PartialEq, Eq)] | ||
pub enum Message<Ctx> | ||
where | ||
Ctx: Context, | ||
{ | ||
Propose(Ctx::Proposal), | ||
Vote(SignedVote<Ctx>), | ||
Decide(Round, Ctx::Value), | ||
ScheduleTimeout(Timeout), | ||
NewRound(Round), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters