java.lang.Object
io.hotmoka.patricia.PatriciaTries
Provider of Merkle-Patricia tries.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA function that supplies an unmarshalling context. -
Method Summary
Modifier and TypeMethodDescriptionstatic <Key,Value extends io.hotmoka.marshalling.api.Marshallable>
PatriciaTrie<Key,Value> of(KeyValueStore store, Hasher<? super Key> hasherForKeys, HashingAlgorithm hashingForNodes, io.hotmoka.marshalling.api.Unmarshaller<? extends Value> valueUnmarshaller, PatriciaTries.UnmarshallingContextSupplier unmarshallingContextSupplier, long numberOfCommits) Yields a Merkle-Patricia trie supported by the underlying store, using the given hashing algorithm to hash nodes, keys and the values.
-
Method Details
-
of
public static <Key,Value extends io.hotmoka.marshalling.api.Marshallable> PatriciaTrie<Key,Value> of(KeyValueStore store, Hasher<? super Key> hasherForKeys, HashingAlgorithm hashingForNodes, io.hotmoka.marshalling.api.Unmarshaller<? extends Value> valueUnmarshaller, PatriciaTries.UnmarshallingContextSupplier unmarshallingContextSupplier, long numberOfCommits) Yields a Merkle-Patricia trie supported by the underlying store, using the given hashing algorithm to hash nodes, keys and the values.- Type Parameters:
Key- the type of the keys of the trieValue- the type of the values of the trie- Parameters:
store- the store used to store a mapping from nodes' hashes to their contenthasherForKeys- the hasher for the keyshashingForNodes- the hashing algorithm for the nodes of the trievalueUnmarshaller- a function able to unmarshall a value from its byte representationunmarshallingContextSupplier- the supplier of the unmarshalling contextnumberOfCommits- the current number of commits already executed on the store; this trie will record which data must be garbage collected (eventually) as result of the store updates performed during that commit; this could be -1L if the trie is only used or reading- Returns:
- the trie
-