From da731c48252f43d7bfa171bf3b203c52bdd9285d Mon Sep 17 00:00:00 2001 From: Tobin Harding Date: Thu, 31 Mar 2022 10:57:37 +1100 Subject: [PATCH] Add further description to the NodeInfo struct Further assist devs in understanding the `NodeInfo` struct by adding docs about when/why the struct is used. --- src/util/taproot.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/util/taproot.rs b/src/util/taproot.rs index 77e21f53..500f8931 100644 --- a/src/util/taproot.rs +++ b/src/util/taproot.rs @@ -521,8 +521,12 @@ impl TaprootBuilder { /// Represents the node information in taproot tree. /// -/// You can use [`TaprootSpendInfo::from_node_info`] to a get [`TaprootSpendInfo`] -/// from the merkle root [`NodeInfo`]. +/// Helper type used in merkle tree construction allowing one to build sparse merkle trees. The node +/// represents part of the tree that has information about all of its descendants. +/// See how [`TaprootBuilder`] works for more details. +/// +/// You can use [`TaprootSpendInfo::from_node_info`] to a get a [`TaprootSpendInfo`] from the merkle +/// root [`NodeInfo`]. #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct NodeInfo {