Skip to content

Commit

Permalink
Merge pull request #161 from davxy/master
Browse files Browse the repository at this point in the history
Implement 'Eq' for 'Equivocation' struct
  • Loading branch information
davxy authored Mar 8, 2023
2 parents 218cdc6 + f28f890 commit 6f2d42f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ pub trait Chain<H: Eq, N: Copy + BlockNumberOps> {
}

/// An equivocation (double-vote) in a given round.
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "derive-codec", derive(Encode, Decode, TypeInfo))]
pub struct Equivocation<Id, V, S> {
/// The round number equivocated in.
Expand Down
2 changes: 1 addition & 1 deletion src/vote_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ where
let mut new_best = None;
for d_node in &descendent_nodes {
if let Some(d_block) = d_node.ancestor_block(base_number + offset) {
match descendent_blocks.binary_search_by_key(&d_block, |&(ref x, _)| x) {
match descendent_blocks.binary_search_by_key(&d_block, |(x, _)| x) {
Ok(idx) => {
descendent_blocks[idx].1 += &d_node.cumulative_vote;
if condition(&descendent_blocks[idx].1) {
Expand Down

0 comments on commit 6f2d42f

Please sign in to comment.