Merkle_list.Makemodule El : sig ... endtype h = H.tThe type of a hash
type elt = El.tThe type of an element
A path, together with an element's position, is the proof of inclusion of an element in the Merkle list.
val dummy_path : pathA dummy path that can be used as a placeholder when no path is actually required.
val pp_path :
Tezos_protocol_environment_022_PsRiotum.Format.formatter ->
path ->
unitval nil : tThe empty Merkle list
val empty : hThe empty hash
compute elems returns the root hash of the Merkle list constructed with elems.
val path_encoding :
path Tezos_protocol_environment_022_PsRiotum.Data_encoding.tEncoding of a path.
val bounded_path_encoding :
?max_length:int ->
unit ->
path Tezos_protocol_environment_022_PsRiotum.Data_encoding.tEncoding of a path, with optional bound max_length.
val compute_path :
t ->
int ->
path Tezos_protocol_environment_022_PsRiotum.Error_monad.tzresultcompute_path t pos computes the path of the element in position pos.
Can fail with Merkle_list_invalid_position if pos is negative or if it is greater than the number of elements in the list.
val check_path :
path ->
int ->
elt ->
h ->
bool Tezos_protocol_environment_022_PsRiotum.Error_monad.tzresultcheck_path path pos elt expected_root checks that an elt with path path at position pos has the expected_root.
Can fail with Merkle_list_invalid_position if pos is negative or if it is greater than the number of elements in the list.
val path_depth : path -> intpath_depth path returns the depth of the tree path is related to.
val elt_bytes : elt -> Tezos_protocol_environment_022_PsRiotum.Bytes.t