Compare the subtrees in `Chain` (#7562)

This commit is contained in:
Marek 2023-09-18 05:44:26 +02:00 committed by GitHub
parent a7501c16b1
commit dea9a8c536
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -281,6 +281,10 @@ impl Chain {
// history trees
self.history_trees_by_height == other.history_trees_by_height &&
// note commitment subtrees
self.sapling_subtrees == other.sapling_subtrees &&
self.orchard_subtrees == other.orchard_subtrees &&
// anchors
self.sprout_anchors == other.sprout_anchors &&
self.sprout_anchors_by_height == other.sprout_anchors_by_height &&

View File

@ -624,6 +624,10 @@ fn different_blocks_different_chains() -> Result<()> {
chain1.sapling_trees_by_height = chain2.sapling_trees_by_height.clone();
chain1.orchard_trees_by_height = chain2.orchard_trees_by_height.clone();
// note commitment subtrees
chain1.sapling_subtrees = chain2.sapling_subtrees.clone();
chain1.orchard_subtrees = chain2.orchard_subtrees.clone();
// history trees
chain1.history_trees_by_height = chain2.history_trees_by_height.clone();