package tezos-protocol-alpha
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=ad9e08819871c75ba6f4530b125f7d157799398e4d77a1e6bfea9d91ff37ff55
sha512=c5dc4d40cc09bc6980fbbdb5c2e105bf4252cf9cfcb2b49660b0ebe4dc789f6709ec3b3bf2f87d81580d3eed9521eeb1c960f24d9b14eb0285aaba1f84d10a9b
doc/tezos-protocol-alpha.raw/Tezos_raw_protocol_alpha/Tx_rollup_commitment_repr/Merkle/index.html
Module Tx_rollup_commitment_repr.Merkle
Source
The type of a Merkle list
The type of a hash
The type of an element
A path, together with an element's position, is the proof of inclusion of an element in the Merkle list.
A dummy path that can be used as a placeholder when no path is actually required.
snoc t el
adds element el
to a Merkle list t
and returns the new list.
compute elems
returns the root hash of the Merkle list constructed with elems
.
Encoding of a path.
val bounded_path_encoding :
?max_length:int ->
unit ->
path Tezos_protocol_environment_alpha.Data_encoding.t
Encoding of a path, with optional bound max_length
.
compute_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_alpha.Error_monad.tzresult
check_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.