Skip to content

Commit

Permalink
Compare the subtrees in Chain (#7562)
Browse files Browse the repository at this point in the history
  • Loading branch information
upbqdn authored Sep 18, 2023
1 parent a7501c1 commit dea9a8c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions zebra-state/src/service/non_finalized_state/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down
4 changes: 4 additions & 0 deletions zebra-state/src/service/non_finalized_state/tests/prop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit dea9a8c

Please sign in to comment.