order invariant seal equality
This commit is contained in:
parent
d0eab4a0d8
commit
49b953a9f4
@ -26,12 +26,21 @@ pub struct VoteCollector {
|
|||||||
votes: RwLock<BTreeMap<ConsensusMessage, Address>>
|
votes: RwLock<BTreeMap<ConsensusMessage, Address>>
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Eq)]
|
#[derive(Debug)]
|
||||||
pub struct SealSignatures {
|
pub struct SealSignatures {
|
||||||
pub proposal: H520,
|
pub proposal: H520,
|
||||||
pub votes: Vec<H520>
|
pub votes: Vec<H520>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl PartialEq for SealSignatures {
|
||||||
|
fn eq(&self, other: &SealSignatures) -> bool {
|
||||||
|
self.proposal == other.proposal
|
||||||
|
&& self.votes.iter().collect::<HashSet<_>>() == other.votes.iter().collect::<HashSet<_>>()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Eq for SealSignatures {}
|
||||||
|
|
||||||
impl VoteCollector {
|
impl VoteCollector {
|
||||||
pub fn new() -> VoteCollector {
|
pub fn new() -> VoteCollector {
|
||||||
let mut collector = BTreeMap::new();
|
let mut collector = BTreeMap::new();
|
||||||
|
Loading…
Reference in New Issue
Block a user