@@ -345,6 +345,7 @@ impl TaprootSpendInfo {
345345/// branches in a DFS(Depth first search) walk to construct this tree.
346346// Similar to Taproot Builder in bitcoin core
347347#[ derive( Debug , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
348+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
348349pub struct TaprootBuilder {
349350 // The following doc-comment is from bitcoin core, but modified for rust
350351 // The comment below describes the current state of the builder for a given tree.
@@ -484,7 +485,8 @@ impl TaprootBuilder {
484485
485486// Internally used structure to represent the node information in taproot tree
486487#[ derive( Debug , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
487- struct NodeInfo {
488+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
489+ pub ( crate ) struct NodeInfo {
488490 /// Merkle Hash for this node
489491 hash : sha256:: Hash ,
490492 /// information about leaves inside this node
@@ -537,7 +539,8 @@ impl NodeInfo {
537539
538540// Internally used structure to store information about taproot leaf node
539541#[ derive( Debug , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
540- struct LeafInfo {
542+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
543+ pub ( crate ) struct LeafInfo {
541544 // The underlying script
542545 script : Script ,
543546 // The leaf version
@@ -567,6 +570,7 @@ impl LeafInfo {
567570// The type of hash is sha256::Hash because the vector might contain
568571// both TapBranchHash and TapLeafHash
569572#[ derive( Debug , Clone , PartialEq , Eq , PartialOrd , Ord , Hash , Default ) ]
573+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
570574pub struct TaprootMerkleBranch ( Vec < sha256:: Hash > ) ;
571575
572576impl TaprootMerkleBranch {
@@ -638,6 +642,7 @@ impl TaprootMerkleBranch {
638642
639643/// Control Block data structure used in Tapscript satisfaction
640644#[ derive( Debug , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
645+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
641646pub struct ControlBlock {
642647 /// The tapleaf version,
643648 pub leaf_version : LeafVersion ,
@@ -744,6 +749,7 @@ impl ControlBlock {
744749
745750/// The leaf version for tapleafs
746751#[ derive( Debug , Clone , Copy , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
752+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
747753pub struct LeafVersion ( u8 ) ;
748754
749755impl Default for LeafVersion {
0 commit comments