From 33d75659dac697a9ffdb684fbd202ebcaf21505c Mon Sep 17 00:00:00 2001 From: Martin Habovstiak Date: Sat, 15 Mar 2025 19:38:48 +0100 Subject: [PATCH] Push `merkle_branch` module one level deeper. This moves the content of the module into `buf` submodule making future changes clearer. --- .../taproot/{merkle_branch.rs => merkle_branch/buf.rs} | 2 +- bitcoin/src/taproot/merkle_branch/mod.rs | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) rename bitcoin/src/taproot/{merkle_branch.rs => merkle_branch/buf.rs} (98%) create mode 100644 bitcoin/src/taproot/merkle_branch/mod.rs diff --git a/bitcoin/src/taproot/merkle_branch.rs b/bitcoin/src/taproot/merkle_branch/buf.rs similarity index 98% rename from bitcoin/src/taproot/merkle_branch.rs rename to bitcoin/src/taproot/merkle_branch/buf.rs index 6a523ba8d..d89559fcc 100644 --- a/bitcoin/src/taproot/merkle_branch.rs +++ b/bitcoin/src/taproot/merkle_branch/buf.rs @@ -92,7 +92,7 @@ impl TaprootMerkleBranchBuf { } /// Appends elements to proof. - pub(super) fn push(&mut self, h: TapNodeHash) -> Result<(), InvalidMerkleTreeDepthError> { + pub(in super::super) fn push(&mut self, h: TapNodeHash) -> Result<(), InvalidMerkleTreeDepthError> { if self.len() >= TAPROOT_CONTROL_MAX_NODE_COUNT { Err(InvalidMerkleTreeDepthError(self.0.len())) } else { diff --git a/bitcoin/src/taproot/merkle_branch/mod.rs b/bitcoin/src/taproot/merkle_branch/mod.rs new file mode 100644 index 000000000..838fe0b6e --- /dev/null +++ b/bitcoin/src/taproot/merkle_branch/mod.rs @@ -0,0 +1,9 @@ +//! Contains `TaprootMerkleBranchBuf` and its associated types. + +mod buf; + +pub use buf::TaprootMerkleBranchBuf; +use super::{ + InvalidMerkleBranchSizeError, InvalidMerkleTreeDepthError, TapNodeHash, TaprootError, + TAPROOT_CONTROL_MAX_NODE_COUNT, TAPROOT_CONTROL_NODE_SIZE, +};