Skip to content

Commit

Permalink
Apply documentation suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Jack Grigg <thestr4d@gmail.com>
  • Loading branch information
nuttycom and str4d committed Sep 27, 2024
1 parent 9a77e51 commit 3f59900
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
6 changes: 4 additions & 2 deletions incrementalmerkletree-testing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ pub trait Tree<H, C> {
/// Returns the number of levels in the tree.
fn depth(&self) -> u8;

/// Appends a new value to the tree at the next available slot. Returns true if successful and
/// false if the tree would exceed the maximum allowed number of levels in the tree.
/// Appends a new value to the tree at the next available slot.
///
/// Returns true if successful and false if the tree would exceed
/// the maximum allowed number of levels in the tree.
fn append(&mut self, value: H, retention: Retention<C>) -> bool;

/// Returns the most recently appended leaf value.
Expand Down
12 changes: 6 additions & 6 deletions shardtree/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ witnessing and rewinding operations.
each return the computed root as an optional value, returning `Ok(None)` if
the checkpoint corresponding to the requested identifier does not exist.
- `ShardTree::root_at_checkpoint_depth` and `root_at_checkpoint_depth_caching`
now takes the `checkpoint_depth` argument as `Option<usize>` instead of
`usize`. The semantics of this method are now changed such that if a
now take their `checkpoint_depth` argument as `Option<usize>` instead of
`usize`. The semantics of these methods are now changed such that if a
checkpoint depth is provided, it is now treated strictly as a zero-based
index into the checkpoints of the tree in reverse order of checkpoint
identifier, and an error is returned if no checkpoint exists at the given
Expand All @@ -67,12 +67,12 @@ witnessing and rewinding operations.
not exist.
- `ShardTree::witness_at_checkpoint_depth` and `witness_at_checkpoint_depth_caching`
now each return the computed witness as an optional value, returning
`Ok(None)` if no checkpoint was available at the given checkpoint depth.The
`Ok(None)` if no checkpoint was available at the given checkpoint depth. The
semantics of this method are now changed such that if a checkpoint depth is
provided, it is now treated strictly as a zero-based index into the
checkpoints of the tree in reverse order of checkpoint identifier, and an
error is returned if no checkpoint exists at the given index. IT IS NO LONGER
POSSIBLE TO COMPUTE A WITNESS WITHOUT A CHECKPOINT BEING PRESENT IN THE TREE.
checkpoints of the tree in reverse order of checkpoint identifier. IT IS NO
LONGER POSSIBLE TO COMPUTE A WITNESS WITHOUT A CHECKPOINT BEING PRESENT IN
THE TREE.
- `shardtree::store::ShardStore`:
- The semantics of `ShardStore::get_checkpoint_at_depth` HAVE CHANGED WITHOUT
CHANGES TO THE METHOD SIGNATURE. The `checkpoint_depth` argument to this
Expand Down

0 comments on commit 3f59900

Please sign in to comment.