Module tari_mmr::functions[][src]

Functions

`calculate_mmr_root`` takes an MMR instance and efficiently calculates the new MMR root by applying the given additions to calculate a new MMR root without changing the original MMR.

Create a pruned Merkle Mountain Range from the provided MMR. Pruning entails throwing all the hashes of the pruned MMR away, except for the current peaks. A new MMR instance is returned that allows you to continue adding onto the MMR as before. Most functions of the pruned MMR will work as expected, but obviously, any leaf hashes prior to the base point won’t be available. get_leaf_hash will return None for those nodes, and validate will throw an error.

A convenience function in the same vein as prune_mmr, but applied to MutableMmr instances.

Type Definitions