package octez-shell-libs

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

This module provides functions used for tests.

type 'a timeout_t = {
  1. time : float;
    (*

    Duration of the timeout.

    *)
  2. msg : 'a -> string;
    (*

    Create the error message.

    *)
}

Is a timeout used with wait_pred function.

val wait_pred : ?timeout:'a timeout_t -> pred:('a -> bool) -> arg:'a -> unit -> unit Tezos_base.TzPervasives.tzresult Lwt.t

wait_pred wait until pred arg is true. If pred is not satisfy after timeout.time seconds a Timeout (timeout.msg arg) error is raised.

val wait_pred_s : ?timeout:'a timeout_t -> pred:('a -> bool Lwt.t) -> arg:'a -> unit -> unit Tezos_base.TzPervasives.tzresult Lwt.t

Same as wait_pred.

val wait_conns : ?timeout:float -> pool:('a, 'b, 'c) Tezos_p2p.P2p_pool.t -> int -> unit Tezos_base.TzPervasives.tzresult Lwt.t

Based on wait_pred. wait_conns ~pool n waits until at least n connections are actives in ~pool.

connect_all connect_handler points establishes the connections to points using connect_handler and returns them. If one connection need more than ?timeout seconds to be established, the function fails with Timeout error.

val close_active_conns : ('a, 'b, 'c) Tezos_p2p.P2p_pool.t -> unit Lwt.t

close_active_conns pool@ closes all actives connections of the pool. This function waits until the connections are effectively closed.

val canceler : Lwt_canceler.t
val proof_of_work_target : Tezos_crypto.Crypto_box.pow_target
OCaml

Innovation. Community. Security.