package tezos-baking-alpha

  1. Overview
  2. Docs
type loop_state
val sleep_until : Tezos_base.Time.Protocol.t -> unit Lwt.t option
val wait_next_event : timeout:Baking_state.timeout_kind Lwt.t -> loop_state -> (Baking_state.event option, Tezos_error_monad.TzCore.error list) Stdlib.result Lwt.t

An event monitor using the streams in loop_state (to create promises) and a timeout promise timeout. The function reacts to a promise being fulfilled by firing an event Baking_state.event.

val compute_next_potential_baking_time_at_next_level : Baking_state.state -> (Tezos_base.Time.Protocol.t * Tezos_protocol_alpha.Protocol.Alpha_context.Round.t) option Lwt.t
val compute_next_timeout : Baking_state.state -> (Baking_state.timeout_kind Lwt.t, Tezos_error_monad.TzCore.error list) Stdlib.result Lwt.t
val compute_bootstrap_event : Baking_state.state -> (Baking_state.event, Tezos_error_monad.TzCore.error list) Stdlib.result
val automaton_loop : ?stop_on_event:(Baking_state.event -> bool) -> config:Baking_configuration.t -> on_error: (Tezos_error_monad.TzCore.error list -> (unit, Tezos_error_monad.TzCore.error list) Stdlib.result Lwt.t) -> loop_state -> Baking_state.state -> Baking_state.event -> (Baking_state.event option, Tezos_error_monad.TzCore.error list) Stdlib.result Lwt.t
OCaml

Innovation. Community. Security.