Merkle Mountain Range macro
Include ["mmr_macro"] feature in merkle-heapless dependency
Necessary compiler features
// compulsory at the beginning of the .rs file in order the macro to compile
// snip
### Declaration and instantiation
use ;
// declaration with expicit type name for your MMR
mmr!;
let mmr = default;
// implicitly creates MerkleMountainRange type
mmr!;
// create with default current peak of height 0
let mmr = default;
// or create with current peak of height 2
let mmr = from_peak;
assert_eq!;
Functionality
The functionality of Mountain Range is similar to that of the Merkle tree.
mmr.try_append.unwrap;
// peak leaf numbers: [1, 0, 0, 0, 0]
assert_eq!;
assert_eq!;
assert_eq!;
let proof = mmr.generate_proof;
assert!;