Commit Graph

15 Commits

Author SHA1 Message Date
Kris Nuttycombe 8864a84d19 Introduce a simple binary tree type. 2023-03-08 11:07:58 -07:00
Kris Nuttycombe 0697df7d95 Fix documentation errors. 2023-03-03 17:02:03 -07:00
Kris Nuttycombe 6867240e5a Remove the `current_leaf` method from `Tree`
The notion of `current` doesn't make a lot of sense in the context of
out-of-order insertion.
2023-02-16 15:01:53 -07:00
Kris Nuttycombe 0e2329cebc Fix a missed Authpath -> Witness rename. 2023-02-16 15:01:53 -07:00
Kris Nuttycombe 14bb9c6b1b Modify test infrastructure to allow shardtree testing.
This removes the `mark` function from the `tree` interface, in favor
of always appending nodes as marked, as that's what's needed in
practice, rather than the ability to mutably mark the latest position at
arbitrary states of the tree.

This removal does mean that a few patterns of interleaved mark and
checkpoint operations are no longer being tested in the shared test
suite; however, such interleaving of operations is not something that
we should need to support anyway.
2023-02-16 15:01:53 -07:00
Kris Nuttycombe aa1d59f47a `witness` now witnesses at a checkpoint, rather than a root.
This change exposed an inconsistency in how `BridgeTree` and
`CompleteTree` were tracking `Mark` operations, which has now also been
fixed.

The behavior of the "unmark" operation has been simplified, such that it
now ensures that a marked node will be made eligible for garbage
collection when the checkpoint for the tree state in which the mark was
forgotten rolls off the back of the checkpoint queue.
2023-02-16 15:01:53 -07:00
Kris Nuttycombe 8998f839ce Change `append` to take ownership of the value being appended.
It is now up to the caller to clone the value if necessary.
2023-01-04 14:08:11 -07:00
Kris Nuttycombe 0dde92c699 Move `testing::lazy_root` to `testing::complete_tree::root` & make crate-private
The former name didnt make sense anyway, because there's nothing lazy
about the result.
2022-12-21 14:48:53 -07:00
Kris Nuttycombe 4e2883c707 Move CombinedTree to incrementalmerkletree::testing 2022-12-21 12:53:17 -07:00
Kris Nuttycombe 3f88ac3af2 Move complete_tree testing module to incrementalmerkletree 2022-12-21 12:53:17 -07:00
Kris Nuttycombe a8c5ce1c98 Move `check_operations` to `incrementalmerkletree::testing` 2022-12-21 12:53:17 -07:00
Kris Nuttycombe 6b4bcda423 Move shared example tests to incrementalmerkletree::testing 2022-12-21 12:53:17 -07:00
Kris Nuttycombe 6b6d108de6 Move randomized test generators to incrementalmerkletree 2022-12-21 12:53:17 -07:00
Kris Nuttycombe eb3413837e Move `Tree` and `Frontier` traits to `incementalmerkletree::testing` 2022-12-21 12:53:17 -07:00
Kris Nuttycombe c5c6c65799 Move position & hashable types to incrementalmerkletree root. 2022-12-21 12:52:57 -07:00