Making all LeafInfo fields private

This commit is contained in:
Dr Maxim Orlovsky 2022-03-31 15:56:48 +02:00
parent d655ff3e93
commit 3c502ffc2d
No known key found for this signature in database
GPG Key ID: FFC0250947E5C6F7
2 changed files with 6 additions and 6 deletions

View File

@ -327,9 +327,9 @@ impl Serialize for TapTree {
//
// TaprootMerkleBranch can only have len atmost 128(TAPROOT_CONTROL_MAX_NODE_COUNT).
// safe to cast from usize to u8
buf.push(leaf_info.merkle_branch.as_inner().len() as u8);
buf.push(leaf_info.ver.to_consensus());
leaf_info.script.consensus_encode(&mut buf).expect("Vecs dont err");
buf.push(leaf_info.merkle_branch().as_inner().len() as u8);
buf.push(leaf_info.leaf_version().to_consensus());
leaf_info.script().consensus_encode(&mut buf).expect("Vecs dont err");
}
buf
}

View File

@ -610,11 +610,11 @@ impl NodeInfo {
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct LeafInfo {
/// The underlying script.
pub(crate) script: Script,
script: Script,
/// The leaf version.
pub(crate) ver: LeafVersion,
ver: LeafVersion,
/// The merkle proof (hashing partners) to get this node.
pub(crate) merkle_branch: TaprootMerkleBranch,
merkle_branch: TaprootMerkleBranch,
}
impl LeafInfo {