pub struct SmtMap256 { /* fields omitted */ }
SmtMap256 is Sparse Merkle Tree Map from uint256 keys to uint256 values, and supports
generating 256-bit merkle proofs. Initially every of the 2**256 possible keys has a default
value of zero.
Each leaf corresponds to a key-value pair. The key is the bit-path from the root to the leaf
(starting from the most-significant-bit to the least-significant-bit; 0 is left, 1 is right).
The value is stored as the hash of the leaf node (in big-endian).
The hash of an non-leaf node is calculated by hashing (using keccak-256) the concatenation of
the hashes of its two sub-nodes.
Returns a new SMT-Map of uint256 where all keys have the default value (zero).
Sets the value of a key. Returns the old value of the key.
Returns a reference to the value of a key.
Returns a reference to the value of the key with merkle proof.
Returns the merkle root of this Sparse Merkle Tree.
Verifies the value of a key using the merkle proof. Returns whether the verification passed.
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static