tuweni / org.apache.tuweni.trie / StoredMerklePatriciaTrie / create

create

@JvmStatic fun <V> create(storage: MerkleStorage, valueSerializer: Function<V, Bytes>, valueDeserializer: Function<Bytes, V>): StoredMerklePatriciaTrie<V> (source)

Create a trie.

Parameters

storage - The storage to use for persistence.

valueSerializer - A function for serializing values to bytes.

valueDeserializer - A function for deserializing values from bytes.

Parameters

Return
A new merkle trie.

@JvmStatic fun <V> create(storage: MerkleStorage, rootHash: Bytes32, valueSerializer: Function<V, Bytes>, valueDeserializer: Function<Bytes, V>): StoredMerklePatriciaTrie<V> (source)

Create a trie.

Parameters

storage - The storage to use for persistence.

rootHash - The initial root has for the trie, which should be already present in storage.

valueSerializer - A function for serializing values to bytes.

valueDeserializer - A function for deserializing values from bytes.

Parameters

Return
A new merkle trie.