Skip to content

Commit

Permalink
primitives: add LeafScript::with constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Oct 6, 2023
1 parent 8efffe9 commit fb1f8e5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions primitives/src/taproot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,11 @@ impl From<TapScript> 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) }
}

Expand Down

0 comments on commit fb1f8e5

Please sign in to comment.