package tezt-tezos

  1. Overview
  2. Docs
type endpoint =
  1. | Node of Dac_node.t
  2. | Foreign_endpoint of Foreign_endpoint.t
type t

The type of a dac client.

val create : ?runner:Tezt.Runner.t -> ?name:string -> ?path:string -> ?base_dir:string -> ?color:Tezt.Log.Color.t -> Dac_node.t -> t

create ?runner ?name ?base_dir ?color dac_node creates a new Dac_client.t that can be used to send commands to dac_node.

val create_with_endpoint : ?runner:Tezt.Runner.t -> ?name:string -> ?path:string -> ?base_dir:string -> ?color:Tezt.Log.Color.t -> endpoint -> t

create_with_endpoint also creates a new Dac_client.t, but without assuming the DAC node the client will interact with is a node managed by Tezt.

type output =
  1. | Root_hash of Hex.t
  2. | Certificate of Hex.t

The output of a dac client command. Can be either a root hash or a certificate.

val send_hex_payload : ?hooks:Tezt.Process_hooks.t -> ?threshold:int -> t -> Hex.t -> output Lwt.t

send_hex_payload ?hooks ?threshold dac_client hex sends the Hex payload hex to the coordinator of dac_client. If the threshold value is specified, the command will wait for a Certificate with an amount of signatures greater or equal to threshold, before returning. Otherwise, the Root_hash of the payload is returned.

val send_payload_from_file : ?hooks:Tezt.Process_hooks.t -> ?threshold:int -> t -> string -> output Lwt.t

send_payload_from_file ?hooks ?threshold dac_client filename reads the payload content from file and sends it to the coordinator of dac_client. If the threshold value is specified, then the command will wait for a Certificate with an amount of signatures greater or equal to threshold, before returning. Otherwise, the Root_hash of the payload is returned.

val get_certificate : ?hooks:Tezt.Process_hooks.t -> t -> Hex.t -> output option Lwt.t

get_certificate ?hooks dac_client root_hash returns the certificate available to the coordinator of dac_client for root_hash, if any. Otherwise, None is returned.

OCaml

Innovation. Community. Security.