package tezos-protocol-008-PtEdo2Zk

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type kind =
  1. | Proposal
    (*

    protocols can be proposed

    *)
  2. | Testing_vote
    (*

    a proposal can be voted

    *)
  3. | Testing
    (*

    winning proposal is forked on a testnet

    *)
  4. | Promotion_vote
    (*

    activation can be voted

    *)
  5. | Adoption
    (*

    a delay before activation

    *)

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

val kind_encoding : kind Data_encoding.t
type voting_period = {
  1. index : int32;
  2. kind : kind;
  3. start_position : int32;
}

A voting period can be of 5 kinds and is uniquely identified by a counter since the root.

type t = voting_period
type info = {
  1. voting_period : t;
  2. position : int32;
  3. remaining : int32;
}
val root : start_position:int32 -> t
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 encoding : t Data_encoding.t
val info_encoding : info Data_encoding.t
val pp : Stdlib.Format.formatter -> t -> unit
val pp_info : Stdlib.Format.formatter -> info -> unit
val pp_kind : Stdlib.Format.formatter -> kind -> unit
val reset : t -> start_position:int32 -> t

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 succ : t -> start_position:int32 -> t

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.

val position_since : Level_repr.t -> t -> int32
val remaining_blocks : Level_repr.t -> t -> blocks_per_voting_period:int32 -> int32
OCaml

Innovation. Community. Security.