package tezt-tezos
type commitment_info = {
commitment_and_hash : commitment_and_hash;
first_published_at_level : int option;
included_at_level : int option;
}
type simulation_result = {
state_hash : string;
status : string;
output : Tezt.JSON.t;
inbox_level : int;
num_ticks : int;
}
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
.
val rpc_get :
?hooks:Tezt.Process.hooks ->
t ->
Client.path ->
Tezt.JSON.t Runnable.process
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 =
| Value : string option durable_state_operation
| Length : int64 option durable_state_operation
| 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).
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
.
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_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 ->
string list ->
simulation_result Runnable.process
simulate ?block client ?reveal_pages 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.
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.