From fb1f8e5043f706c7a7edde41fb712f1ccce34dbe Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Fri, 6 Oct 2023 13:17:25 +0200 Subject: [PATCH] primitives: add LeafScript::with constructor --- primitives/src/taproot.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/primitives/src/taproot.rs b/primitives/src/taproot.rs index 2fc4b5a0..fba58f83 100644 --- a/primitives/src/taproot.rs +++ b/primitives/src/taproot.rs @@ -417,7 +417,11 @@ impl From for LeafScript { } impl LeafScript { + #[inline] + pub fn with(version: LeafVer, script: ScriptBytes) -> Self { LeafScript { version, script } } + #[inline] pub fn from_tap_script(tap_script: TapScript) -> Self { Self::from(tap_script) } + #[inline] pub fn tap_leaf_hash(&self) -> TapLeafHash { TapLeafHash::with_leaf_script(self) } }