You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#[test]fntest_partial_mmr_untrack(){// build the MMRlet mmr:Mmr = LEAVES.into();// get path and node for position 1let node1 = mmr.get(1).unwrap();let proof1 = mmr.open(1).unwrap();// create partial MMR and add authentication path to node at position 1letmut partial_mmr:PartialMmr = mmr.peaks().into();
partial_mmr.track(1, node1,&proof1.merkle_path).unwrap();
partial_mmr.untrack(1);}
This test panics when calling untrack with:
thread 'merkle::mmr::partial::tests::test_partial_mmr_untrack' panicked at src/merkle/mmr/inorder.rs:95:19:
attempt to shift left with overflow
I would expect this to not panic when untracking a tracked leaf.
The text was updated successfully, but these errors were encountered:
Great catch! Seems like this method wasn't really tested. I haven't really looked into it in-depth, but I think maybe re-writing untrack() like so could fix the issue:
This test panics when calling
untrack
with:I would expect this to not panic when untracking a tracked leaf.
The text was updated successfully, but these errors were encountered: