Skip to content

Commit 274c90e

Browse files
committed
Make LeafInfo::leaf_hash public and change its name and return type
1 parent 424df29 commit 274c90e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/util/taproot.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ impl NodeInfo {
579579
pub fn new_leaf_with_ver(script: Script, ver: LeafVersion) -> Self {
580580
let leaf = LeafInfo::new(script, ver);
581581
Self {
582-
hash: leaf.hash(),
582+
hash: sha256::Hash::from_inner(leaf.leaf_hash().into_inner()),
583583
leaves: vec![leaf],
584584
has_hidden_nodes: false,
585585
}
@@ -628,9 +628,9 @@ impl LeafInfo {
628628
}
629629

630630
/// Computes a leaf hash for this [`LeafInfo`].
631-
fn hash(&self) -> sha256::Hash {
632-
let leaf_hash = TapLeafHash::from_script(&self.script, self.ver);
633-
sha256::Hash::from_inner(leaf_hash.into_inner())
631+
#[inline]
632+
pub fn leaf_hash(&self) -> TapLeafHash {
633+
TapLeafHash::from_script(&self.script, self.ver)
634634
}
635635
}
636636

0 commit comments

Comments
 (0)