package tezos-proxy

  1. Overview
  2. Docs

Module containing operations of Merkle proofs used by the light mode

Transform a Merkle tree into an Irmin tree. Parameters are:

* The repo where the result should live * The Merkle tree to translate

Returns: The Irmin tree obtained or an error message

val contains_merkle_tree : Tezos_context_memory.Context.tree -> Tezos_shell_services.Block_services.merkle_tree -> (unit, string) Stdlib.result Lwt.t

Whether an Irmin tree contains a Merkle tree (in particular whether they agree on hashes). Returns unit if the Irmin tree contains the Merkle tree, otherwise a message explaining why it is not the case.

Union an Irmin tree and a Merkle tree. Parameters are:

* The repo where the Irmin tree is stored (necessary to create shallow trees from Merkle hashes) * The Irmin tree * The Merkle tree

Returns: an augmented variant of the input Irmin tree or an error message.

val trees_shape_match : string list -> Tezos_shell_services.Block_services.merkle_tree -> Tezos_shell_services.Block_services.merkle_tree -> (unit, string list) Stdlib.result

trees_shape_match path t1 t2 returns Ok () if t1 and t2 have the same shape (tree of keys), otherwise an Error explaining how the shapes differ. The shape check tolerates a shape difference for nodes along the key's path (because at the end of this path, the first endpoint returns data; whereas validating endpoints return a hash).

OCaml

Innovation. Community. Security.