Skip to content

Commit 6f2d42f

Browse files
authored
Merge pull request #161 from davxy/master
Implement 'Eq' for 'Equivocation' struct
2 parents 218cdc6 + f28f890 commit 6f2d42f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ pub trait Chain<H: Eq, N: Copy + BlockNumberOps> {
208208
}
209209

210210
/// An equivocation (double-vote) in a given round.
211-
#[derive(Clone, Debug, PartialEq)]
211+
#[derive(Clone, Debug, PartialEq, Eq)]
212212
#[cfg_attr(feature = "derive-codec", derive(Encode, Decode, TypeInfo))]
213213
pub struct Equivocation<Id, V, S> {
214214
/// The round number equivocated in.

src/vote_graph.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ where
405405
let mut new_best = None;
406406
for d_node in &descendent_nodes {
407407
if let Some(d_block) = d_node.ancestor_block(base_number + offset) {
408-
match descendent_blocks.binary_search_by_key(&d_block, |&(ref x, _)| x) {
408+
match descendent_blocks.binary_search_by_key(&d_block, |(x, _)| x) {
409409
Ok(idx) => {
410410
descendent_blocks[idx].1 += &d_node.cumulative_vote;
411411
if condition(&descendent_blocks[idx].1) {

0 commit comments

Comments
 (0)