diff --git a/Cargo.lock b/Cargo.lock index bbc99b6..4e49083 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -318,7 +318,7 @@ dependencies = [ [[package]] name = "shardtree" -version = "0.3.1" +version = "0.3.2" dependencies = [ "assert_matches", "bitflags 2.4.1", diff --git a/shardtree/CHANGELOG.md b/shardtree/CHANGELOG.md index ec396f4..766a6a4 100644 --- a/shardtree/CHANGELOG.md +++ b/shardtree/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to Rust's notion of ## Unreleased +## [0.3.2] - 2024-12-09 +- Replaces `unwrap` calls with `expect` calls & documents panics. + ## [0.3.1] - 2024-04-03 ### Fixed diff --git a/shardtree/Cargo.toml b/shardtree/Cargo.toml index 6bae130..ffdaeef 100644 --- a/shardtree/Cargo.toml +++ b/shardtree/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "shardtree" -version = "0.3.1" +version = "0.3.2" authors = [ "Kris Nuttycombe ", ] diff --git a/shardtree/src/legacy.rs b/shardtree/src/legacy.rs index e151ae7..8db0442 100644 --- a/shardtree/src/legacy.rs +++ b/shardtree/src/legacy.rs @@ -167,6 +167,10 @@ impl LocatedPrunableTree { /// /// Returns a copy of this tree updated to include the witness nodes, any partial supertree that is /// produced from nodes "higher" in the witness tree + /// + /// # Panics + /// + /// Panics if `witness` corresponds to the empty tree. pub fn insert_witness_nodes( &self, witness: IncrementalWitness, diff --git a/shardtree/src/lib.rs b/shardtree/src/lib.rs index bb60eef..ce5686e 100644 --- a/shardtree/src/lib.rs +++ b/shardtree/src/lib.rs @@ -391,6 +391,10 @@ impl< } /// Adds a checkpoint at the rightmost leaf state of the tree. + /// + /// # Panics + /// + /// Panics if `root` represents a parent node but `root_addr` is a depth-0 leaf address. pub fn checkpoint(&mut self, checkpoint_id: C) -> Result> { /// Pre-condition: `root_addr` must be the address of `root`. fn go(