mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 07:01:03 +00:00
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:
committed by
Robert Habermeier
parent
7cb0d73944
commit
7ecd8496a7
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user