https://gitlab.com/tezos/tezos
Raw File
Tip revision: 9084c1b158dccbffbefeb9b15b67797f8a76334c authored by Alain Mebsout on 25 April 2023, 15:30:41 UTC
Doc: remove -alpha suffix for smart rollup node
Tip revision: 9084c1b
sigs.ml
(*****************************************************************************)
(*                                                                           *)
(* Open Source License                                                       *)
(* Copyright (c) 2022 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.                                                 *)
(*                                                                           *)
(*****************************************************************************)

module type PROTOCOL = sig
  type context

  module Tez : sig
    type t

    val zero : t

    val compare : t -> t -> int

    val ( +? ) : t -> t -> t tzresult

    val to_mutez : t -> int64
  end

  module Signature : sig
    type public_key_hash

    type public_key

    type secret_key

    type signature

    module To_latest : sig
      val public_key_hash :
        public_key_hash -> Tezos_crypto.Signature.V_latest.public_key_hash

      val public_key : public_key -> Tezos_crypto.Signature.V_latest.public_key

      val secret_key : secret_key -> Tezos_crypto.Signature.V_latest.secret_key

      val signature : signature -> Tezos_crypto.Signature.V_latest.signature
    end
  end

  module Delegate : sig
    val fold :
      context ->
      order:[`Sorted | `Undefined] ->
      init:'a ->
      f:(Signature.public_key_hash -> 'a -> 'a Lwt.t) ->
      'a Lwt.t

    val pubkey :
      context ->
      Signature.public_key_hash ->
      Signature.public_key tzresult Lwt.t

    val staking_balance :
      context -> Signature.public_key_hash -> Tez.t tzresult Lwt.t

    val deactivated :
      context -> Signature.public_key_hash -> bool tzresult Lwt.t
  end

  val hash : Protocol_hash.t

  val prepare_context :
    Tezos_protocol_environment.Context.t ->
    level:int32 ->
    predecessor_timestamp:Time.Protocol.t ->
    timestamp:Time.Protocol.t ->
    context tzresult Lwt.t
end

type protocol = (module PROTOCOL)
back to top