mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-30 23:37:56 +00:00
babe: small compilation fix (#3764)
* babe: fix type on find_pre_digest call * fork-tree: optimize prune * babe: fix test compilation
This commit is contained in:
@@ -896,7 +896,7 @@ impl<B, E, Block, I, RA, PRA> BlockImport<Block> for BabeBlockImport<B, E, Block
|
||||
.expect("best finalized hash was given by client; \
|
||||
finalized headers must exist in db; qed");
|
||||
|
||||
find_pre_digest::<Block>(&finalized_header)
|
||||
find_pre_digest::<Block::Header>(&finalized_header)
|
||||
.expect("finalized header must be valid; \
|
||||
valid blocks have a pre-digest; qed")
|
||||
.slot_number()
|
||||
|
||||
@@ -625,7 +625,7 @@ fn importing_epoch_change_block_prunes_tree() {
|
||||
};
|
||||
|
||||
let mut proposer = environ.init(&parent_header).unwrap();
|
||||
let parent_pre_digest = find_pre_digest::<Block>(&parent_header).unwrap();
|
||||
let parent_pre_digest = find_pre_digest(&parent_header).unwrap();
|
||||
|
||||
let pre_digest = sr_primitives::generic::Digest {
|
||||
logs: vec![
|
||||
|
||||
@@ -115,10 +115,11 @@ impl<H, N, V> ForkTree<H, N, V> where
|
||||
|
||||
// we found the deepest ancestor of the finalized block, so we prune
|
||||
// out any children that don't include the finalized block.
|
||||
root.children.retain(|node| {
|
||||
let children = std::mem::replace(&mut root.children, Vec::new());
|
||||
root.children = children.into_iter().filter(|node| {
|
||||
node.number == *number && node.hash == *hash ||
|
||||
node.number < *number && is_descendent_of(&node.hash, hash).unwrap_or(false)
|
||||
});
|
||||
}).take(1).collect();
|
||||
|
||||
self.roots = vec![root];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user