package tezt-tezos

  1. Overview
  2. Docs
type t

Smart-Contract Rollup client state

type commitment = {
  1. compressed_state : string;
  2. inbox_level : int;
  3. predecessor : string;
  4. number_of_ticks : int;
}
type commitment_and_hash = {
  1. commitment : commitment;
  2. hash : string;
}
type commitment_info = {
  1. commitment_and_hash : commitment_and_hash;
  2. first_published_at_level : int option;
  3. included_at_level : int option;
}
type slot_header = {
  1. level : int;
  2. commitment : string;
  3. index : int;
}
type simulation_result = {
  1. state_hash : string;
  2. status : string;
  3. output : Tezt.JSON.t;
  4. inbox_level : int;
  5. num_ticks : int;
  6. insights : string option list;
}
val create : protocol:Protocol.t -> ?runner:Tezt.Runner.t -> ?name:string -> ?base_dir:string -> ?color:Tezt.Log.Color.t -> Sc_rollup_node.t -> t

create ~protocol ?runner ?name ?base_dir node returns a fresh client identified by a specified name, logging in color, executing the program at path, storing local information in base_dir, and communicating with the specified node, using the runner.

val sc_rollup_address : ?hooks:Tezt.Process.hooks -> t -> string Runnable.process

sc_rollup_address client returns the smart contract rollup address of the node associated to the client.

rpc_get client path issues a GET request for path.

val rpc_post : ?hooks:Tezt.Process.hooks -> t -> Client.path -> Tezt.JSON.t -> Tezt.JSON.t Runnable.process

rpc_post client path data issues a POST request for path with data.

val rpc_get_rich : ?hooks:Tezt.Process.hooks -> t -> Client.path -> (string * string) list -> Tezt.JSON.t Runnable.process

rpc_get_rich client path parameters issues a GET request for path passing parameters.

val total_ticks : ?hooks:Tezt.Process.hooks -> ?block:string -> t -> int Runnable.process

total_ticks ?block client gets the total number of ticks for the PVM.

val ticks : ?hooks:Tezt.Process.hooks -> ?block:string -> t -> int Runnable.process

ticks ?block client gets the number of ticks for the PVM for the block (default "head").

val state_hash : ?hooks:Tezt.Process.hooks -> ?block:string -> t -> string Runnable.process

state_hash ?block client gets the corresponding PVM state hash for the block (default "head").

val state_current_level : ?hooks:Tezt.Process_hooks.t -> ?block:string -> t -> int Runnable.process

state_current_level ?block client gets the corresponding PVM state current level for the block (default "head").

val state_value : ?hooks:Tezt.Process.hooks -> ?block:string -> t -> key:string -> bytes Runnable.process

state_value ?block client key gets the corresponding PVM state value mapped to key for the block (default "head").

type 'output_type durable_state_operation =
  1. | Value : string option durable_state_operation
  2. | Length : int64 option durable_state_operation
  3. | Subkeys : string list durable_state_operation
val inspect_durable_state_value : ?hooks:Tezt.Process.hooks -> ?block:string -> t -> pvm_kind:string -> operation:'a durable_state_operation -> key:string -> 'a Runnable.process

inspect_durable_state_value ?block client key gets the corresponding durable PVM state value mapped to key for the block (default "head").

val status : ?hooks:Tezt.Process.hooks -> ?block:string -> t -> string Runnable.process

status ?block client gets the corresponding PVM status for the block (default "head").

val outbox : ?hooks:Tezt.Process.hooks -> ?block:string -> outbox_level:int -> t -> Tezt.JSON.t Runnable.process

outbox ?block outbox_level client gets the rollup outbox of outbox_level as known to the block (default "cemented" which is the block corresponding to the last cemented level).

type outbox_proof = {
  1. commitment_hash : string;
  2. proof : string;
}
val outbox_proof_single : ?hooks:Tezt.Process.hooks -> ?expected_error:Tezt.Base.rex -> ?entrypoint:string -> ?parameters_ty:string -> t -> message_index:int -> outbox_level:int -> destination:string -> parameters:string -> outbox_proof option Lwt.t

outbox_proof_single asks the rollup node for a proof that an output of a given message_index is available in the outbox at a given outbox_level as a latent call to destination's entrypoint with the given parameters.

type transaction = {
  1. destination : string;
  2. entrypoint : string option;
  3. parameters : string;
  4. parameters_ty : string option;
}
val outbox_proof : ?hooks:Tezt.Process.hooks -> ?expected_error:Tezt.Base.rex -> t -> message_index:int -> outbox_level:int -> outbox_proof option Lwt.t

Same as outbox_proof_single without providing the outbox message

val outbox_proof_batch : ?hooks:Tezt.Process.hooks -> ?expected_error:Tezt.Base.rex -> t -> message_index:int -> outbox_level:int -> transaction list -> outbox_proof option Lwt.t

Same as outbox_proof_single except that the claim is about a batch of output transactions.

val encode_json_outbox_msg : ?hooks:Tezt.Process.hooks -> t -> Tezt.JSON.u -> string Runnable.process

encode_json_outbox_msg outbox_msg_json returns the encoding of an outbox message.

val encode_batch : ?hooks:Tezt.Process.hooks -> ?expected_error:Tezt.Base.rex -> t -> transaction list -> string option Lwt.t

encode_batch batch returns the encoding of a batch of output transactions.

val commitment_from_json : Tezt.JSON.t -> commitment option

commitment_from_json parses a commitment from its JSON representation.

val commitment_info_from_json : Tezt.JSON.t -> commitment_info option

commitment_info_from_json parses a commitment, its hash and the levels when the commitment was first published (if any) and included, from the JSON representation.

val last_stored_commitment : ?hooks:Tezt.Process.hooks -> t -> commitment_and_hash option Runnable.process

last_stored_commitment client gets the last commitment with its hash stored by the rollup node.

val last_published_commitment : ?hooks:Tezt.Process.hooks -> t -> commitment_info option Runnable.process

last_published_commitment client gets the last commitment published by the rollup node, with its hash and level when the commitment was first published and the level it was included.

val dal_slot_headers : ?hooks:Tezt.Process.hooks -> ?block:string -> t -> slot_header list Runnable.process

dal_slot_headers ?block client returns the dal slot headers of the block (default "head").

val get_dal_processed_slots : ?hooks:Tezt.Process.hooks -> ?block:string -> t -> (int * string) list Runnable.process

get_dal_processed_slots ?block client returns the slots indices that have been marked by the rollup node as confirmed or unconfirmed for block block (default "head"), with their statuses.

val simulate : ?hooks:Tezt.Process_hooks.t -> ?block:string -> t -> ?reveal_pages:string list -> ?insight_requests: [ `Pvm_state_key of string list | `Durable_storage_key of string list ] list -> string list -> simulation_result Runnable.process

simulate ?block client ?reveal_pages ?insight_request messages simulates the evaluation of input messages for the rollup PVM at block (default "head"). reveal_pages can be used to provide data to be used for the revelation ticks. insight_request can be used to look at a list of keys in the PVM state after the simulation.

val inject : ?hooks:Tezt.Process_hooks.t -> t -> string list -> string list Runnable.process

inject client messages injects the messages in the queue the rollup node's batcher and returns the list of message hashes injected.

val batcher_queue : ?hooks:Tezt.Process_hooks.t -> t -> (string * string) list Runnable.process

batcher_queue client returns the queue of messages, as pairs of message hash and binary message, in the batcher.

val get_batcher_msg : ?hooks:Tezt.Process_hooks.t -> t -> string -> (string * Tezt.JSON.t) Runnable.process

get_batcher_msg client hash fetches the message whose hash is hash from the queue. It returns the message together with the full JSON response including the status.

val generate_keys : ?hooks:Tezt.Process.hooks -> ?force:bool -> alias:string -> t -> unit Lwt.t

generate_keys ~alias client generates new unencrypted keys for alias.

val list_keys : ?hooks:Tezt.Process.hooks -> t -> (string * string) list Lwt.t

list_keys client returns the known aliases with their public key hash from client.

Fails if the format isn't in the form `<alias>: <public key hash>`.

val show_address : ?hooks:Tezt.Process.hooks -> alias:string -> t -> Account.aggregate_key Lwt.t

show_address ~alias client returns the BLS account associated with alias.

Fails if the output from the client isn't in the expected format (see Client.show_address).

val import_secret_key : ?hooks:Tezt.Process.hooks -> ?force:bool -> Account.aggregate_key -> t -> unit Lwt.t

import_secret_key account imports account.alias as alias to account.secret_key into the client.

OCaml

Innovation. Community. Security.