@@ -560,7 +560,7 @@ pub struct NodeInfo {
560
560
/// Merkle hash for this node.
561
561
pub ( crate ) hash : sha256:: Hash ,
562
562
/// Information about leaves inside this node.
563
- pub ( crate ) leaves : Vec < LeafInfo > ,
563
+ pub ( crate ) leaves : Vec < ScriptLeaf > ,
564
564
/// Tracks information on hidden nodes below this node.
565
565
pub ( crate ) has_hidden_nodes : bool ,
566
566
}
@@ -577,7 +577,7 @@ impl NodeInfo {
577
577
578
578
/// Creates a new leaf [`NodeInfo`] with given [`Script`] and [`LeafVersion`].
579
579
pub fn new_leaf_with_ver ( script : Script , ver : LeafVersion ) -> Self {
580
- let leaf = LeafInfo :: new ( script, ver) ;
580
+ let leaf = ScriptLeaf :: new ( script, ver) ;
581
581
Self {
582
582
hash : sha256:: Hash :: from_inner ( leaf. leaf_hash ( ) . into_inner ( ) ) ,
583
583
leaves : vec ! [ leaf] ,
@@ -608,7 +608,7 @@ impl NodeInfo {
608
608
/// Store information about taproot leaf node.
609
609
#[ derive( Debug , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
610
610
#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
611
- pub struct LeafInfo {
611
+ pub struct ScriptLeaf {
612
612
/// The underlying script.
613
613
script : Script ,
614
614
/// The leaf version.
@@ -617,8 +617,8 @@ pub struct LeafInfo {
617
617
merkle_branch : TaprootMerkleBranch ,
618
618
}
619
619
620
- impl LeafInfo {
621
- /// Creates an new [`LeafInfo `] from `script` and `ver` and no merkle branch.
620
+ impl ScriptLeaf {
621
+ /// Creates an new [`ScriptLeaf `] from `script` and `ver` and no merkle branch.
622
622
fn new ( script : Script , ver : LeafVersion ) -> Self {
623
623
Self {
624
624
script : script,
@@ -635,7 +635,7 @@ impl LeafInfo {
635
635
self . merkle_branch . 0 . len ( ) as u8
636
636
}
637
637
638
- /// Computes a leaf hash for this [`LeafInfo `].
638
+ /// Computes a leaf hash for this [`ScriptLeaf `].
639
639
#[ inline]
640
640
pub fn leaf_hash ( & self ) -> TapLeafHash {
641
641
TapLeafHash :: from_script ( & self . script , self . ver )
0 commit comments