package octez-shell-libs

  1. Overview
  2. Docs
Octez shell libraries

Install

Dune Dependency

Authors

Maintainers

Sources

tezos-18.0.tar.gz
sha256=dbc3b675aee59c2c574e5d0a771193a2ecfca31e7a5bc5aed66598080596ce1c
sha512=b97ed762b9d24744305c358af0d20f394376b64bfdd758dd4a81775326caf445caa57c4f6445da3dd6468ff492de18e4c14af6f374dfcbb7e4d64b7b720e5e2a

doc/octez-shell-libs.p2p_test_common/Tezos_p2p_test_common/P2p_test_utils/index.html

Module Tezos_p2p_test_common.P2p_test_utilsSource

This module provides functions used for tests.

Sourcetype '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.

Sourceval 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.

Sourceval 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.

Sourceval 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.

Sourceval 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.

Sourceval canceler : Lwt_canceler.t
Sourceval proof_of_work_target : Tezos_crypto.Crypto_box.pow_target
Sourceval raw_accept : Tezos_p2p.P2p_io_scheduler.t -> Lwt_unix.file_descr -> (Tezos_p2p.P2p_io_scheduler.connection * (Tezos_base.TzPervasives.P2p_addr.t * int), [ `Socket_error of exn | `System_error of exn | `Unexpected_error of exn ]) result Lwt.t
Sourceval raw_connect : Tezos_p2p.P2p_io_scheduler.t -> Tezos_base.TzPervasives.P2p_addr.t -> int -> (Tezos_p2p.P2p_io_scheduler.connection, [ `Connection_refused | `Unexpected_error of exn ]) result Lwt.t
OCaml

Innovation. Community. Security.