client: fix comparison of CachedHeaderMetadata in tree_route (#3776)

* client: fix comparison of CachedHeaderMetadata in tree_route

* client: add regression test for tree_route
This commit is contained in:
André Silva
2019-10-07 14:28:28 +01:00
committed by Robert Habermeier
parent 7cb0d73944
commit 7ecd8496a7
2 changed files with 36 additions and 2 deletions
@@ -122,7 +122,7 @@ pub fn tree_route<Block: BlockT, T: HeaderMetadata<Block>>(
// numbers are equal now. walk backwards until the block is the same
while to != from {
while to.hash != from.hash {
to_branch.push(HashAndNumber {
number: to.number,
hash: to.hash,
@@ -257,7 +257,7 @@ impl<Block: BlockT> HeaderMetadata<Block> for HeaderMetadataCache<Block> {
}
/// Cached header metadata. Used to efficiently traverse the tree.
#[derive(Debug, Clone, Eq, PartialEq)]
#[derive(Debug, Clone)]
pub struct CachedHeaderMetadata<Block: BlockT> {
/// Hash of the header.
pub hash: Block::Hash,