Skip to content

Commit

Permalink
Remove Value::is_valid as proposal validity is now handled outside …
Browse files Browse the repository at this point in the history
…of the state machine by the driver
  • Loading branch information
romac committed Nov 7, 2023
1 parent d517da1 commit 45d4575
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
3 changes: 0 additions & 3 deletions Code/common/src/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,4 @@ where

/// The ID of the value.
fn id(&self) -> Self::Id;

/// Whether the value is valid.
fn is_valid(&self) -> bool;
}
9 changes: 4 additions & 5 deletions Code/round/src/state_machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,10 @@ where
if this_round && proposal.pol_round().is_nil() =>
{
// L22
if proposal.value().is_valid()
&& state
.locked
.as_ref()
.map_or(true, |locked| &locked.value == proposal.value())
if state
.locked
.as_ref()
.map_or(true, |locked| &locked.value == proposal.value())
{
state.proposal = Some(proposal.clone());
prevote(state, data.address, &proposal)
Expand Down
4 changes: 0 additions & 4 deletions Code/test/src/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ impl Value {
impl malachite_common::Value for Value {
type Id = ValueId;

fn is_valid(&self) -> bool {
self.valid()
}

fn id(&self) -> ValueId {
self.id()
}
Expand Down

0 comments on commit 45d4575

Please sign in to comment.