Commit fb6bb69
feat!: MerkleTree-specific Type Aliases (#251)
This PR introduces type aliases:
- `MerkleTreeNodeIndex` for `usize`
- `MerkleTreeLeafIndex` for `usize`
- `MerkleTreeHeight` for `u32`
with the objective of documenting the conventions for
arithmetic with these index types.
Also:
- Public function `nodes()` dropped in favor of `node(i)`.
- Public function `leafs()` now returns an iterator instead
of a slice.
- Private function `authentication_structure_node_indices` is
marked `pub` as it is needed downstream.
Displaces #250.
---------
Co-authored-by: Jan Ferdinand Sauer <ferdinand@neptune.cash>1 parent 8c942b4 commit fb6bb69
File tree
5 files changed
+178
-110
lines changed- twenty-first
- benches
- src/util_types
- mmr
5 files changed
+178
-110
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | | - | |
| 59 | + | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
0 commit comments