Skip to content

Commit

Permalink
Rename TaprootBuilder::is_complete into is_finalized
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Apr 5, 2022
1 parent efa800f commit b0f3992
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/util/psbt/map/output.rs
Expand Up @@ -141,7 +141,7 @@ impl TapTree {
/// A [`TapTree`] iff the `inner` builder is complete, otherwise return [`IncompleteTapTree`]
/// error with the content of incomplete builder `inner` instance.
pub fn from_inner(inner: TaprootBuilder) -> Result<Self, IncompleteTapTree> {
if !inner.is_complete() {
if !inner.is_finalized() {
Err(IncompleteTapTree::NotFinalized(inner))
} else {
Ok(TapTree(inner))
Expand Down
2 changes: 1 addition & 1 deletion src/util/psbt/serialize.rs
Expand Up @@ -355,7 +355,7 @@ impl Deserialize for TapTree {
builder = builder.add_leaf_with_ver(*depth, script, leaf_version)
.map_err(|_| encode::Error::ParseFailed("Tree not in DFS order"))?;
}
if builder.is_complete() {
if builder.is_finalized() {
Ok(TapTree(builder))
} else {
Err(encode::Error::ParseFailed("Incomplete taproot Tree"))
Expand Down
4 changes: 2 additions & 2 deletions src/util/taproot.rs
Expand Up @@ -461,8 +461,8 @@ impl TaprootBuilder {
self.insert(node, depth)
}

/// Checks if the builder is a complete tree.
pub fn is_complete(&self) -> bool {
/// Checks if the builder has finalized building a tree.
pub fn is_finalized(&self) -> bool {
self.branch.len() == 1 && self.branch[0].is_some()
}

Expand Down

0 comments on commit b0f3992

Please sign in to comment.