Tezos_raw_protocol_023_PtSeouLo.Level_reprThis module defines the protocol representation of a level. Besides the "raw level", which is the shell's notion of the level, this representation also contains additional information, like the cycle the level belongs to.
type t = private {level : Raw_level_repr.t;The level of the block relative to genesis. This is also the Shell's notion of level.
*)level_position : int32;The level of the block relative to the block that starts the alpha family of protocols.
*)cycle : Cycle_repr.t;The current cycle's number. Note that cycles are a protocol-specific notion. As a result, the cycle number starts at 0 with the first block of the first version of protocol alpha.
*)cycle_position : int32;The current level of the block relative to the first block of the current cycle.
*)expected_commitment : bool;}type level = tinclude Tezos_protocol_environment_023_PtSeouLo.Compare.S with type t := levelmodule Map : Tezos_protocol_environment_023_PtSeouLo.Map.S with type key = tval encoding : level Tezos_protocol_environment_023_PtSeouLo.Data_encoding.tval pp : 
  Tezos_protocol_environment_023_PtSeouLo.Format.formatter ->
  level ->
  unitval pp_full : 
  Tezos_protocol_environment_023_PtSeouLo.Format.formatter ->
  level ->
  unittype cycle_era = {first_level : Raw_level_repr.t;The first level of a cycle era.
*)first_cycle : Cycle_repr.t;The first cycle of a cycle era.
*)blocks_per_cycle : int32;The value of the blocks_per_cycle constant used during the cycle era starting with first_level.
*)blocks_per_commitment : int32;The value of the blocks_per_commitment constant used during the cycle era starting with first_level.
*)}A cycle era is a chunk of cycles having the same number of levels per cycle and the same number of blocks per commitment.
val cycle_eras_encoding : 
  cycle_eras Tezos_protocol_environment_023_PtSeouLo.Data_encoding.tval create_cycle_eras : 
  cycle_era list ->
  cycle_eras Tezos_protocol_environment_023_PtSeouLo.Error_monad.tzresultPreconditions on the input list of cycle eras:
val add_cycle_era : 
  cycle_era ->
  cycle_eras ->
  cycle_eras Tezos_protocol_environment_023_PtSeouLo.Error_monad.tzresultAdd a new cycle era
val update_cycle_eras : 
  cycle_eras ->
  level:int32 ->
  prev_blocks_per_cycle:int32 ->
  new_blocks_per_cycle:int32 ->
  prev_blocks_per_commitment:int32 ->
  new_blocks_per_commitment:int32 ->
  cycle_eras Tezos_protocol_environment_023_PtSeouLo.Error_monad.tzresultupdate cycle eras when blocks_per_commitment and/or blocks_per_cycle change at a given level, usually at protocol change.
val current_era : cycle_eras -> cycle_eraReturns the current era
val root_level : cycle_eras -> levelReturns the first level of the oldest era
val level_zero_use_with_care : levelLevel zero, that belongs to cycle zero. This level representation is hardcoded and might not verify properties of properly built levels. Only use this if you need a default value and know that it's going to be handled properly.
Currently used in Full_staking_balance_repr.encoding to signal a decoded value from an old protocol.
val cycle_from_raw : cycle_eras:cycle_eras -> Raw_level_repr.t -> Cycle_repr.tReturns the cycle corresponding to a raw level
val level_from_raw : cycle_eras:cycle_eras -> Raw_level_repr.t -> levelReturns the annotated level corresponding to a raw level
val level_from_raw_with_offset : 
  cycle_eras:cycle_eras ->
  offset:int32 ->
  Raw_level_repr.t ->
  level Tezos_protocol_environment_023_PtSeouLo.Error_monad.tzresultReturns the annotated level corresponding to a raw level and an offset. A positive offset corresponds to a higher level. Fails with Negative_level_and_offset_sum if the sum of the raw_level and the offset is negative. Fails with Level_not_in_alpha if the sum of the raw_level and the offset is a level before the first level in the Alpha family of protocols.
val first_level_in_cycle_from_eras : 
  cycle_eras:cycle_eras ->
  Cycle_repr.t ->
  levelReturns the first level of the given cycle.
val last_of_cycle : cycle_eras:cycle_eras -> level -> boolReturns true if the given level is the last of a cycle.
module Internal_for_tests : sig ... end