From 4cdff06b1e54bd16b39626aa8eda8b3bd31e6e2c Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Wed, 6 Apr 2022 13:51:51 +0200 Subject: [PATCH] Add convenience method TapTree:to_builder --- src/util/psbt/map/output.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/util/psbt/map/output.rs b/src/util/psbt/map/output.rs index 483ea8ba..2545497d 100644 --- a/src/util/psbt/map/output.rs +++ b/src/util/psbt/map/output.rs @@ -162,6 +162,12 @@ impl TapTree { self.0 } + /// Constructs [`TaprootBuilder`] by internally cloning the `self`. The builder is guaranteed + /// to be finalized. + pub fn to_builder(&self) -> TaprootBuilder { + self.0.clone() + } + /// Returns [`TapTreeIter`] iterator for a taproot script tree, operating in DFS order over /// tree [`ScriptLeaf`]s. pub fn script_leaves(&self) -> TapTreeIter {