From b0f3992db16cbfb571160039f59e0c426404b997 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Tue, 5 Apr 2022 22:26:36 +0200 Subject: [PATCH] Rename TaprootBuilder::is_complete into is_finalized --- src/util/psbt/map/output.rs | 2 +- src/util/psbt/serialize.rs | 2 +- src/util/taproot.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/util/psbt/map/output.rs b/src/util/psbt/map/output.rs index 643fc59a..c3f4c295 100644 --- a/src/util/psbt/map/output.rs +++ b/src/util/psbt/map/output.rs @@ -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 { - if !inner.is_complete() { + if !inner.is_finalized() { Err(IncompleteTapTree::NotFinalized(inner)) } else { Ok(TapTree(inner)) diff --git a/src/util/psbt/serialize.rs b/src/util/psbt/serialize.rs index 8a83f1cd..319e3a72 100644 --- a/src/util/psbt/serialize.rs +++ b/src/util/psbt/serialize.rs @@ -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")) diff --git a/src/util/taproot.rs b/src/util/taproot.rs index 1fc7a4f9..325feaa6 100644 --- a/src/util/taproot.rs +++ b/src/util/taproot.rs @@ -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() }