Module Mavryk_raw_protocol_alpha.Voting_period_repr

type kind =
  1. | Proposal
    (*

    protocols can be proposed

    *)
  2. | Exploration
    (*

    a proposal can be voted

    *)
  3. | Cooldown
    (*

    a delay before the second vote of the Promotion period.

    *)
  4. | Promotion
    (*

    activation can be voted

    *)
  5. | Adoption
    (*

    a delay before activation

    *)

The voting period kinds are ordered as follows: Proposal -> Exploration -> Cooldown -> Promotion -> Adoption. This order is the one used be the function succ below.

type voting_period = {
  1. index : Mavryk_protocol_environment_alpha.Int32.t;
  2. kind : kind;
  3. start_position : Mavryk_protocol_environment_alpha.Int32.t;
}

A voting period can be of several kinds and is uniquely identified by the counter 'index'. The 'start_position' represents the relative position of the first level of the period with respect to the first level of the Alpha family of protocols.

type t = voting_period
type info = {
  1. voting_period : t;
  2. position : Mavryk_protocol_environment_alpha.Int32.t;
  3. remaining : Mavryk_protocol_environment_alpha.Int32.t;
}

Information about a block with respect to the voting period it belongs to: the voting period, the position within the voting period and the number of remaining blocks till the end of the period. The following invariant is satisfied: `position + remaining + 1 = blocks_per_voting_period`

val root : start_position:Mavryk_protocol_environment_alpha.Int32.t -> t
include Mavryk_protocol_environment_alpha.Compare.S with type t := voting_period
val (=) : voting_period -> voting_period -> bool
val (<>) : voting_period -> voting_period -> bool
val (<) : voting_period -> voting_period -> bool
val (<=) : voting_period -> voting_period -> bool
val (>=) : voting_period -> voting_period -> bool
val (>) : voting_period -> voting_period -> bool
val compare : voting_period -> voting_period -> int
val equal : voting_period -> voting_period -> bool
val raw_reset : t -> start_position:Mavryk_protocol_environment_alpha.Int32.t -> t

raw_reset period ~start_position increment the index by one and set the kind to Proposal which is the period kind that start the voting process. start_position is the level at wich this voting_period started.

val raw_succ : t -> start_position:Mavryk_protocol_environment_alpha.Int32.t -> t

raw_succ period ~start_position increment the index by one and set the kind to its successor. start_position is the level at which this voting_period started.