diff --git a/src/util/psbt/map/output.rs b/src/util/psbt/map/output.rs index 74d27d5ac2..2545c1e937 100644 --- a/src/util/psbt/map/output.rs +++ b/src/util/psbt/map/output.rs @@ -194,7 +194,7 @@ impl TryFrom for TapTree { /// A [`TapTree`] iff the `builder` is complete, otherwise return [`IncompleteTapTree`] /// error with the content of incomplete `builder` instance. fn try_from(builder: TaprootBuilder) -> Result { - if !builder.is_finalized() { + if !builder.is_finalizable() { Err(IncompleteTapTree::NotFinalized(builder)) } else if builder.has_hidden_nodes() { Err(IncompleteTapTree::HiddenParts(builder)) diff --git a/src/util/psbt/serialize.rs b/src/util/psbt/serialize.rs index 441728a3bc..c10b98f286 100644 --- a/src/util/psbt/serialize.rs +++ b/src/util/psbt/serialize.rs @@ -343,7 +343,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_finalized() && !builder.has_hidden_nodes() { + if builder.is_finalizable() && !builder.has_hidden_nodes() { Ok(TapTree(builder)) } else { Err(encode::Error::ParseFailed("Incomplete taproot Tree")) diff --git a/src/util/taproot.rs b/src/util/taproot.rs index f81037086d..5b0db30d42 100644 --- a/src/util/taproot.rs +++ b/src/util/taproot.rs @@ -441,7 +441,7 @@ impl TaprootBuilder { } /// Checks if the builder has finalized building a tree. - pub fn is_finalized(&self) -> bool { + pub fn is_finalizable(&self) -> bool { self.branch.len() == 1 && self.branch[0].is_some() } @@ -452,8 +452,8 @@ impl TaprootBuilder { /// Creates a [`TaprootSpendInfo`] with the given internal key. /// - /// Returns the unmodified builder as Err if the builder is not finalized. - /// See also [`TaprootBuilder::is_finalized`] + /// Returns the unmodified builder as Err if the builder is not finalizable. + /// See also [`TaprootBuilder::is_finalizable`] pub fn finalize( mut self, secp: &Secp256k1,