class StoredMerklePatriciaTrie<V> : MerkleTrie<Bytes, V>
(source)
A MerkleTrie that persists trie nodes to a MerkleStorage key/value store.
Parameters
<init> |
Create a trie. StoredMerklePatriciaTrie(storage: MerkleStorage, valueSerializer: (V) -> Bytes, valueDeserializer: (Bytes) -> V) StoredMerklePatriciaTrie(storage: MerkleStorage, rootHash: Bytes32, valueSerializer: (V) -> Bytes, valueDeserializer: (Bytes) -> V) |
clearCache |
Forces any cached trie nodes to be released, so they can be garbage collected. fun clearCache(): Unit |
get |
Returns the value that corresponds to the specified key, or an empty byte array if no such value exists. suspend fun get(key: Bytes): V? |
put |
Updates the value that corresponds to the specified key, creating the value if one does not already exist. suspend fun put(key: Bytes, value: V?): Unit |
remove |
Deletes the value that corresponds to the specified key, if such a value exists. suspend fun remove(key: Bytes): Unit |
rootHash |
Returns the KECCAK256 hash of the root node of the trie. fun rootHash(): Bytes32 |
toString |
fun toString(): String |
create |
Create a trie. fun <V> create(storage: MerkleStorage, valueSerializer: Function<V, Bytes>, valueDeserializer: Function<Bytes, V>): StoredMerklePatriciaTrie<V> fun <V> create(storage: MerkleStorage, rootHash: Bytes32, valueSerializer: Function<V, Bytes>, valueDeserializer: Function<Bytes, V>): StoredMerklePatriciaTrie<V> |
storingBytes |
Create a trie with value of type Bytes. fun storingBytes(storage: MerkleStorage): StoredMerklePatriciaTrie<Bytes>
Create a trie with keys and values of type Bytes. fun storingBytes(storage: MerkleStorage, rootHash: Bytes32): StoredMerklePatriciaTrie<Bytes> |
storingBytes32 |
Create a trie with keys and values of type Bytes32. fun storingBytes32(storage: MerkleStorage, rootHash: Bytes32): StoredMerklePatriciaTrie<Bytes32> |
storingStrings |
Create a trie with value of type String. fun storingStrings(storage: MerkleStorage): StoredMerklePatriciaTrie<String>
Create a trie with keys and values of type String. fun storingStrings(storage: MerkleStorage, rootHash: Bytes32): StoredMerklePatriciaTrie<String> |