package octez-shell-libs

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Module Protocol_levels represents an associative map of protocol levels to corresponding blocks which supposedly activate new protocols, that is to say blocks that acknowledge a protocol change in the next block.

include Tezos_base.TzPervasives.Map.S with type key = int
type key = int
type !+'a t
val empty : 'a t
val is_empty : 'a t -> bool
val mem : key -> 'a t -> bool
val add : key -> 'a -> 'a t -> 'a t
val update : key -> ('a option -> 'a option) -> 'a t -> 'a t
val singleton : key -> 'a -> 'a t
val remove : key -> 'a t -> 'a t
val merge : (key -> 'a option -> 'b option -> 'c option) -> 'a t -> 'b t -> 'c t
val union : (key -> 'a -> 'a -> 'a option) -> 'a t -> 'a t -> 'a t
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
val iter : (key -> 'a -> unit) -> 'a t -> unit
val iter_e : (key -> 'a -> (unit, 'trace) Stdlib.result) -> 'a t -> (unit, 'trace) Stdlib.result
val iter_s : (key -> 'a -> unit Lwt.t) -> 'a t -> unit Lwt.t
val iter_p : (key -> 'a -> unit Lwt.t) -> 'a t -> unit Lwt.t
val iter_es : (key -> 'a -> (unit, 'trace) Stdlib.result Lwt.t) -> 'a t -> (unit, 'trace) Stdlib.result Lwt.t
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val fold_e : (key -> 'a -> 'b -> ('b, 'trace) Stdlib.result) -> 'a t -> 'b -> ('b, 'trace) Stdlib.result
val fold_s : (key -> 'a -> 'b -> 'b Lwt.t) -> 'a t -> 'b -> 'b Lwt.t
val fold_es : (key -> 'a -> 'b -> ('b, 'trace) Stdlib.result Lwt.t) -> 'a t -> 'b -> ('b, 'trace) Stdlib.result Lwt.t
val for_all : (key -> 'a -> bool) -> 'a t -> bool
val exists : (key -> 'a -> bool) -> 'a t -> bool
val filter : (key -> 'a -> bool) -> 'a t -> 'a t
val filter_map : (key -> 'a -> 'b option) -> 'a t -> 'b t
val partition : (key -> 'a -> bool) -> 'a t -> 'a t * 'a t
val cardinal : 'a t -> int
val bindings : 'a t -> (key * 'a) list
val min_binding : 'a t -> (key * 'a) option
val min_binding_opt : 'a t -> (key * 'a) option
val max_binding : 'a t -> (key * 'a) option
val max_binding_opt : 'a t -> (key * 'a) option
val choose : 'a t -> (key * 'a) option
val choose_opt : 'a t -> (key * 'a) option
val split : key -> 'a t -> 'a t * 'a option * 'a t
val find : key -> 'a t -> 'a option
val find_opt : key -> 'a t -> 'a option
val find_first : (key -> bool) -> 'a t -> (key * 'a) option
val find_first_opt : (key -> bool) -> 'a t -> (key * 'a) option
val find_last : (key -> bool) -> 'a t -> (key * 'a) option
val find_last_opt : (key -> bool) -> 'a t -> (key * 'a) option
val map : ('a -> 'b) -> 'a t -> 'b t
val mapi : (key -> 'a -> 'b) -> 'a t -> 'b t
val to_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_rev_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_from : key -> 'a t -> (key * 'a) Stdlib.Seq.t
val add_seq : (key * 'a) Stdlib.Seq.t -> 'a t -> 'a t
val of_seq : (key * 'a) Stdlib.Seq.t -> 'a t
val iter_ep : (key -> 'a -> (unit, 'error Tezos_error_monad.TzTrace.trace) Stdlib.result Lwt.t) -> 'a t -> (unit, 'error Tezos_error_monad.TzTrace.trace) Stdlib.result Lwt.t
type protocol_info = {
  1. protocol : Tezos_base.TzPervasives.Protocol_hash.t;
  2. activation_block : block_descriptor;
  3. expect_predecessor_context : bool;
}

The type for protocol info.

expect_predecessor_context is a flag which reflects what is referenced by the context hash of a block, depending on its protocol. If the flag is true, the block contains the predecessors context (context before the application of the block). Otherwise, it contains the resulting context hash of the application of the block. An activation block refers to a block which activated a new protocol N+1. Thus, the block header related to that activation block will have a protocol level which differs from its predecessor. As this block aims to activate a new protocol, the next_protocol and protocol fields from the metadata differs: next_protocol refers to the hash of the activated protocol. As a consequence, this block handled by protocol N and is the last block of that protocol.

val equal : protocol_info t -> protocol_info t -> bool

Equality on protocol levels maps.

Encoding for the protocol level's association map.

module Legacy : sig ... end
OCaml

Innovation. Community. Security.