package tezos-protocol-010-PtGRANAD
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=7062cd57addd452852598a2214ade393130efa087b99068d53713bdf912b3680
sha512=08e4091144a03ce3c107fb91a66501bd8b65ca3278917c455a2eaac6df3e108ade63f6ab8340a4bb152d60f404326e464d0ec95d26cafe8e82f870465d24a5fc
doc/tezos-protocol-010-PtGRANAD.raw/Tezos_raw_protocol_010_PtGRANAD/Level_repr/index.html
Module Tezos_raw_protocol_010_PtGRANAD.Level_repr
Source
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;
}
include Tezos_protocol_environment_010_PtGRANAD.Compare.S with type t := level
type 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.
Stores the cycles eras of the Alpha family of protocols
val create_cycle_eras :
cycle_era list ->
cycle_eras Tezos_protocol_environment_010_PtGRANAD.Error_monad.tzresult
Preconditions on the input list of cycle eras:
- the list is not empty
- the first levels and the first cycles are decreasing, meaning that the first era in the list is the current era, and the last era in the list is the oldest era Invariants:
- the first era therefore contains the same constants as in Constants
- the first level of an era is the first level of a cycle
Returns the current era
Returns the first level of the oldest era
Returns the annotated level corresponding to a raw level and an offset. A positive offset corresponds to a higher level.
Returns the first level of the given cycle.
Returns true if the given level is the last of a cycle.