Grandpa justifications: Avoid duplicate vote ancestries (#2634) (#2635)

* Grandpa justifications: Avoid duplicate vote ancestries
This commit is contained in:
Serban Iorga authored and Bastian Köcher committed 2024-04-10 10:28:37 +02:00
1 parent 0067c9fa7c
commit dcd2debbb2
7 files changed
+114 -16

No files matched your search

@@ -42,7 +42,7 @@ struct AncestryChain(bp_header_chain::justification::AncestryChain<TestHeader>);
impl AncestryChain {
fn new(justification: &GrandpaJustification<TestHeader>) -> Self {
Self(bp_header_chain::justification::AncestryChain::new(justification))
Self(bp_header_chain::justification::AncestryChain::new(justification).0)
}
}
@@ -58,7 +58,7 @@ impl finality_grandpa::Chain<TestHash, TestNumber> for AncestryChain {
if current_hash == base {
break
}
match self.0.parents.get(&current_hash) {
match self.0.parent_hash_of(&current_hash) {
Some(parent_hash) => {
current_hash = *parent_hash;
route.push(current_hash);