Skip to content

Commit 24e2592

Browse files
author
ChallengeDev210
committed
Rename is_finalized to is_finalizable
I really liked the is_complete naming, but that was changed earlier in b0f3992 Was also suggested by Andrew rust-bitcoin/rust-bitcoin#929 (comment)
1 parent b3e0468 commit 24e2592

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/util/psbt/map/output.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ impl TryFrom<TaprootBuilder> for TapTree {
194194
/// A [`TapTree`] iff the `builder` is complete, otherwise return [`IncompleteTapTree`]
195195
/// error with the content of incomplete `builder` instance.
196196
fn try_from(builder: TaprootBuilder) -> Result<Self, Self::Error> {
197-
if !builder.is_finalized() {
197+
if !builder.is_finalizable() {
198198
Err(IncompleteTapTree::NotFinalized(builder))
199199
} else if builder.has_hidden_nodes() {
200200
Err(IncompleteTapTree::HiddenParts(builder))

src/util/psbt/serialize.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ impl Deserialize for TapTree {
343343
builder = builder.add_leaf_with_ver(*depth, script, leaf_version)
344344
.map_err(|_| encode::Error::ParseFailed("Tree not in DFS order"))?;
345345
}
346-
if builder.is_finalized() && !builder.has_hidden_nodes() {
346+
if builder.is_finalizable() && !builder.has_hidden_nodes() {
347347
Ok(TapTree(builder))
348348
} else {
349349
Err(encode::Error::ParseFailed("Incomplete taproot Tree"))

src/util/taproot.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ impl TaprootBuilder {
441441
}
442442

443443
/// Checks if the builder has finalized building a tree.
444-
pub fn is_finalized(&self) -> bool {
444+
pub fn is_finalizable(&self) -> bool {
445445
self.branch.len() == 1 && self.branch[0].is_some()
446446
}
447447

@@ -452,8 +452,8 @@ impl TaprootBuilder {
452452

453453
/// Creates a [`TaprootSpendInfo`] with the given internal key.
454454
///
455-
/// Returns the unmodified builder as Err if the builder is not finalized.
456-
/// See also [`TaprootBuilder::is_finalized`]
455+
/// Returns the unmodified builder as Err if the builder is not finalizable.
456+
/// See also [`TaprootBuilder::is_finalizable`]
457457
pub fn finalize<C: secp256k1::Verification>(
458458
mut self,
459459
secp: &Secp256k1<C>,

0 commit comments

Comments
 (0)