Skip to content

Commit

Permalink
Remove an outdated assertion in a comment, replace with a test TODO (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
teor2345 authored Apr 3, 2023
1 parent a049e20 commit f556c4a
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions zebra-state/src/service/check/anchors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,24 +155,15 @@ fn fetch_sprout_final_treestates(
.or_else(|| finalized_state.sprout_note_commitment_tree_by_anchor(&joinsplit.anchor));

if let Some(input_tree) = input_tree {
/* TODO:
- fix tests that generate incorrect root data
- assert that roots match the fetched tree during tests
- move this CPU-intensive check to sprout_anchors_refer_to_treestates()
assert_eq!(
input_tree.root(),
joinsplit.anchor,
"anchor and fetched input tree root did not match:\n\
anchor: {anchor:?},\n\
input tree root: {input_tree_root:?},\n\
input_tree: {input_tree:?}",
anchor = joinsplit.anchor
);
*/

sprout_final_treestates.insert(joinsplit.anchor, input_tree);

/* TODO:
- fix tests that generate incorrect root data
- assert that joinsplit.anchor matches input_tree.root() during tests,
but don't assert in production, because the check is CPU-intensive,
and sprout_anchors_refer_to_treestates() constructs the map correctly
*/

tracing::debug!(
sprout_final_treestate_count = ?sprout_final_treestates.len(),
?joinsplit.anchor,
Expand Down

0 comments on commit f556c4a

Please sign in to comment.