Make LeafInfo::leaf_hash public and change its name and return type
This commit is contained in:
parent
c83893d497
commit
5958466678
|
@ -579,7 +579,7 @@ impl NodeInfo {
|
||||||
pub fn new_leaf_with_ver(script: Script, ver: LeafVersion) -> Self {
|
pub fn new_leaf_with_ver(script: Script, ver: LeafVersion) -> Self {
|
||||||
let leaf = LeafInfo::new(script, ver);
|
let leaf = LeafInfo::new(script, ver);
|
||||||
Self {
|
Self {
|
||||||
hash: leaf.hash(),
|
hash: sha256::Hash::from_inner(leaf.leaf_hash().into_inner()),
|
||||||
leaves: vec![leaf],
|
leaves: vec![leaf],
|
||||||
has_hidden_nodes: false,
|
has_hidden_nodes: false,
|
||||||
}
|
}
|
||||||
|
@ -628,9 +628,9 @@ impl LeafInfo {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Computes a leaf hash for this [`LeafInfo`].
|
/// Computes a leaf hash for this [`LeafInfo`].
|
||||||
fn hash(&self) -> sha256::Hash {
|
#[inline]
|
||||||
let leaf_hash = TapLeafHash::from_script(&self.script, self.ver);
|
pub fn leaf_hash(&self) -> TapLeafHash {
|
||||||
sha256::Hash::from_inner(leaf_hash.into_inner())
|
TapLeafHash::from_script(&self.script, self.ver)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue