Skip to main content

🐆 Tx_rollup_message_hash_repr.v

Translated OCaml

See proofs, Gitlab , OCaml

File generated by coq-of-ocaml
Require Import CoqOfOCaml.CoqOfOCaml.
Require Import CoqOfOCaml.Settings.

Require Import TezosOfOCaml.Environment.V7.
Require TezosOfOCaml.Proto_alpha.Tx_rollup_message_repr.
Require TezosOfOCaml.Proto_alpha.Tx_rollup_prefixes.

Definition hash_size : int :=
  Tx_rollup_prefixes.message_hash.(Tx_rollup_prefixes.t.hash_size).

Definition Message_hash :=
  Blake2B.Make
    {|
      Blake2B.Register.register_encoding _ := Base58.register_encoding
    |}
    (let name := "Tx_rollup_inbox_message_hash" in
    let title :=
      "The hash of a transaction rollup inbox" ++
        String.String "226"
          (String.String "128" (String.String "153" "s message")) in
    let b58check_prefix :=
      Tx_rollup_prefixes.message_hash.(Tx_rollup_prefixes.t.b58check_prefix) in
    let size_value := Some hash_size in
    {|
      Blake2B.PrefixedName.name := name;
      Blake2B.PrefixedName.title := title;
      Blake2B.PrefixedName.size_value := size_value;
      Blake2B.PrefixedName.b58check_prefix := b58check_prefix
    |}).

Init function; without side-effects in Coq
Inclusion of the module [Message_hash]
Definition t := Message_hash.(S.HASH.t).

Definition name := Message_hash.(S.HASH.name).

Definition title := Message_hash.(S.HASH.title).

Definition pp := Message_hash.(S.HASH.pp).

Definition pp_short := Message_hash.(S.HASH.pp_short).

Definition op_eq := Message_hash.(S.HASH.op_eq).

Definition op_ltgt := Message_hash.(S.HASH.op_ltgt).

Definition op_lt := Message_hash.(S.HASH.op_lt).

Definition op_lteq := Message_hash.(S.HASH.op_lteq).

Definition op_gteq := Message_hash.(S.HASH.op_gteq).

Definition op_gt := Message_hash.(S.HASH.op_gt).

Definition compare := Message_hash.(S.HASH.compare).

Definition equal := Message_hash.(S.HASH.equal).

Definition max := Message_hash.(S.HASH.max).

Definition min := Message_hash.(S.HASH.min).

Definition hash_bytes := Message_hash.(S.HASH.hash_bytes).

Definition hash_string := Message_hash.(S.HASH.hash_string).

Definition zero := Message_hash.(S.HASH.zero).

Definition size_value := Message_hash.(S.HASH.size_value).

Definition to_bytes := Message_hash.(S.HASH.to_bytes).

Definition of_bytes_opt := Message_hash.(S.HASH.of_bytes_opt).

Definition of_bytes_exn := Message_hash.(S.HASH.of_bytes_exn).

Definition to_b58check := Message_hash.(S.HASH.to_b58check).

Definition to_short_b58check := Message_hash.(S.HASH.to_short_b58check).

Definition of_b58check_exn := Message_hash.(S.HASH.of_b58check_exn).

Definition of_b58check_opt := Message_hash.(S.HASH.of_b58check_opt).

Definition b58check_encoding := Message_hash.(S.HASH.b58check_encoding).

Definition encoding := Message_hash.(S.HASH.encoding).

Definition rpc_arg := Message_hash.(S.HASH.rpc_arg).

Definition hash_uncarbonated (msg : Tx_rollup_message_repr.t)
  : Message_hash.(S.HASH.t) :=
  Message_hash.(S.HASH.hash_bytes) None
    [
      Data_encoding.Binary.to_bytes_exn None Tx_rollup_message_repr.encoding msg
    ].