package tezos-protocol-alpha

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

round_durations represents the duration of rounds in seconds

val pp : Stdlib.Format.formatter -> t -> unit

Creation functions

val create : first_round_duration:Period_repr.t -> delay_increment_per_round:Period_repr.t -> (t, Tezos_protocol_environment_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) Stdlib.result

create ~first_round_duration ~delay_increment_per_round creates a valid duration value

  • parameter first_round_duration

    duration of round 0

  • parameter delay_increment_per_round

    amount of time added in from one round duration to the duration of its next round

  • raises Invalid_argument

    if

    • first_round_duration <= 1; or
    • delay_increment_per_round is <= 0
val create_opt : first_round_duration:Period_repr.t -> delay_increment_per_round:Period_repr.t -> t option

create_opt ~first_round_duration ~delay_increment_per_round returns a valid duration value Some d when create ~first_round_duration ~delay_increment_per_round does not fail. It returns None otherwise.

val encoding : t Data_encoding.t

Warning May trigger an exception when the expected invariant does not hold.

Accessors

val round_duration : t -> round -> Period_repr.t

round_duration round_durations ~round returns the duration of round ~round. This duration follows the arithmetic progression

duration(round_n) = first_round_duration + round_n * delay_increment_per_round

OCaml

Innovation. Community. Security.