Package genlayer.py.storage.tree_map#
Warning
This is an internal module
- class genlayer.py.storage.tree_map.TreeMap[source]#
Represents a mapping from keys to values that can be persisted on the blockchain
K
must implementgenlayer.py.storage.tree_map.Comparable
protocol (“<” and “=” are needed)- compute_if_absent(k: K, supplier: Callable[[], V]) V [source]#
- Returns:
Value associated with k if it is present, otherwise get’s new value from the supplier, stores it at k and returns
- Return type:
V