This commit is contained in:
Paul-Henry Kajfasz 2024-08-21 14:04:23 +01:00
parent e2aeb25e01
commit 8bf6ef890d
No known key found for this signature in database
GPG key ID: 5EB89DCE97DB7417

View file

@ -19,12 +19,12 @@ pub struct MmrPeaks {
/// ///
/// Examples: /// Examples:
/// ///
/// - With 5 leaves, the binary `0b101`. The number of set bits is equal the number of /// - With 5 leaves, the binary `0b101`. The number of set bits is equal the number of peaks,
/// peaks, in this case there are 2 peaks. The 0-indexed least-significant position of the /// in this case there are 2 peaks. The 0-indexed least-significant position of the bit
/// bit determines the number of elements of a tree, so the rightmost tree has `2**0` /// determines the number of elements of a tree, so the rightmost tree has `2**0` elements
/// elements and the left most has `2**2`. /// and the left most has `2**2`.
/// - With 12 leaves, the binary is `0b1100`, this case also has 2 peaks, the leftmost tree /// - With 12 leaves, the binary is `0b1100`, this case also has 2 peaks, the leftmost tree has
/// has `2**3=8` elements, and the right most has `2**2=4` elements. /// `2**3=8` elements, and the right most has `2**2=4` elements.
num_leaves: usize, num_leaves: usize,
/// All the peaks of every tree in the MMR forest. The peaks are always ordered by number of /// All the peaks of every tree in the MMR forest. The peaks are always ordered by number of