https://gitlab.com/tezos/tezos
Raw File
Tip revision: 28912f7e2972e1bf381bfb079d84375f5dfbd586 authored by Gauthier SEBILLE on 02 October 2023, 08:06:29 UTC
RBT: use only and full block hash name for separation in mempool_profiling.txt
Tip revision: 28912f7
types.ml
(*****************************************************************************)
(*                                                                           *)
(* Open Source License                                                       *)
(* Copyright (c) 2023 Nomadic Labs, <contact@nomadic-labs.com>               *)
(*                                                                           *)
(* Permission is hereby granted, free of charge, to any person obtaining a   *)
(* copy of this software and associated documentation files (the "Software"),*)
(* to deal in the Software without restriction, including without limitation *)
(* the rights to use, copy, modify, merge, publish, distribute, sublicense,  *)
(* and/or sell copies of the Software, and to permit persons to whom the     *)
(* Software is furnished to do so, subject to the following conditions:      *)
(*                                                                           *)
(* The above copyright notice and this permission notice shall be included   *)
(* in all copies or substantial portions of the Software.                    *)
(*                                                                           *)
(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)
(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,  *)
(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL   *)
(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)
(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING   *)
(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER       *)
(* DEALINGS IN THE SOFTWARE.                                                 *)
(*                                                                           *)
(*****************************************************************************)

(* TODO: https://gitlab.com/tezos/tezos/-/issues/4621

   Move types from Services.Types to this module.
*)

(** Data kind stored in DAL. *)
type kind = Commitment | Header_status | Slot_id | Slot | Profile

let kind_encoding : kind Data_encoding.t =
  Data_encoding.string_enum
    [
      ("commitment", Commitment);
      ("header_status", Header_status);
      ("slot_id", Slot_id);
      ("slot", Slot);
      ("profile", Profile);
    ]

let kind_to_string data_kind =
  Data_encoding.Binary.to_string_exn kind_encoding data_kind
back to top