package tezt-tezos

  1. Overview
  2. Docs
type payload

Payload of a manager operation. This excludes generic parameters common to all manager operations. See t.

val reveal : Account.key -> payload

Build a public key revelation.

The Account.key argument has no default value because it will typically be a fresh account.

val transfer : ?dest:Account.key -> ?amount:int -> unit -> payload

transfer ?(dest=Constant.bootstrap2) ~amount:1_000_000 () builds a transfer operation. Note that the amount is expressed in mutez.

val origination : ?init_balance:int -> code:Tezt_wrapper.JSON.u -> init_storage:Tezt_wrapper.JSON.u -> unit -> payload

origination ?(init_balance=0) ~code ~init_storage () builds an origination operation.

val call : ?dest:string -> ?amount:int -> ?entrypoint:string -> ?arg:Tezt_wrapper.JSON.u -> unit -> payload

call ~dest ~amount:0 ~entrypoint ~arg () builds a smart contract call operation to the entrypoint with the provided Michelson argument arg. Note that the amount is expressed in mutez.

val dal_publish_commitment : index:int -> commitment:Tezos_crypto_dal.Cryptobox.commitment -> proof:Tezos_crypto_dal.Cryptobox.commitment_proof -> payload

dal_publish_commitment ~level ~index ~header builds an operation for the data-availability layer that publishes a slot.

val delegation : ?delegate:Account.key -> unit -> payload

delegation ?(delegate=Constant.bootstrap2) () builds a delegation operation.

type sc_rollup_proof = Tezt_wrapper.JSON.u

The sc_rollup_proof structure is complex to be written by hand during tests and should likely be generated by a PVM. We expose it as a JSON value.

type sc_rollup_dissection_chunk = {
  1. state_hash : string option;
  2. tick : int;
}

A section of a proof is make of a state hash, if any, and of a tick.

type sc_rollup_game_refutation_step =
  1. | Proof of sc_rollup_proof
  2. | Dissection of sc_rollup_dissection_chunk list

A refutation step is either a dissection or a proof.

type sc_rollup_refutation =
  1. | Start of {
    1. player_commitment_hash : string;
    2. opponent_commitment_hash : string;
    }
  2. | Move of {
    1. choice_tick : int;
    2. refutation_step : sc_rollup_game_refutation_step;
    }

An sc_rollup_refutation is the information submitted by players during a (refutation) game.

val sc_rollup_refute : refutation:sc_rollup_refutation -> sc_rollup:string -> opponent:string -> unit -> payload

sc_rollup_refute ?refutation ~rollup ~oppenent builds an Sc rollup refutation manager operation payload. The refutation is None in case of initialization or some game refutation step (either a dissection or a proof) otherwise. sc_rollup is the Sc rollup's address and opponent the public key hash of the staker who published the commitment we are about to refute.

type t

A representation of a manager operation. This includes generic parameters common to all manager operations. See make.

val make : ?source:Account.key -> ?counter:int -> ?fee:int -> ?gas_limit:int -> ?storage_limit:int -> payload -> t

make builds a manager operation from a payload and generic parameters common to all the manager operations. The default values of the generic parameters are set depending on the payload. Those default values ensure that the operation can be executed correctly. Have a look at the definition of this function to know the default value for each operation payload.

val make_batch : ?source:Account.key -> ?fee:int -> ?gas_limit:int -> ?storage_limit:int -> counter:int -> payload list -> t list

make_batch builds a batch of manager operations from a list of payloads and an initial counter. This function calls make on all the payloads incrementing the initial counter for each operation except for the first one. The function does not fail if the list of payload is empty.

val get_next_counter : ?source:Account.key -> Client.t -> int Lwt.t

get_next_counter ~source client returns the next valid counter value for source expected by the protocol for a manager operation where the source is source. If the source is not provided, the same one as make is used.

json t gives the json representation of a manager operation.

val operation : ?branch:string -> ?signer:Account.key -> t list -> Client.t -> operation Lwt.t

operation ?branch t client constructs an operation from a manager operation. branch can be used to set manually the branch. client can be used to get some meta information such as the counter for the operation.

val inject : ?request:[ `Inject | `Notify ] -> ?force:bool -> ?branch:string -> ?signer:Account.key -> ?error:Tezt_wrapper.Base.rex -> t list -> Client.t -> [ `OpHash of string ] Lwt.t

A wrapper for inject with manager operations. The client is used to get all the data that was not provided if it can be recovered via RPCs. Mainly those are the branch and the counter.

val get_branch : ?chain:string -> ?offset:int -> Client.t -> string Lwt.t

A wrapper for RPC.get_chain_block_hash with an offset for the block.

offset defaults to 2, to pick the latested finalized branch with Tenderbake.

val mk_single_transfer : ?source:Account.key -> ?counter:int -> ?fee:int -> ?gas_limit:int -> ?storage_limit:int -> ?dest:Account.key -> ?amount:int -> ?branch:string -> ?signer:Account.key -> Client.t -> operation Lwt.t

A wrapper for operation on a list consisting in a single transfer. See both functions for details and default values of arguments.

val inject_single_transfer : ?source:Account.key -> ?counter:int -> ?fee:int -> ?gas_limit:int -> ?storage_limit:int -> ?dest:Account.key -> ?amount:int -> ?request:[< `Arrived | `Flush | `Inject | `Notify Inject ] -> ?force:bool -> ?branch:string -> ?signer:Account.key -> ?error:Tezt_wrapper.Base.rex -> Client.t -> [ `OpHash of string ] Lwt.t

A wrapper for injecting a batch consisting in a single transfer. See transfer, make_batch, and inject for the descriptions and default values of the arguments.

OCaml

Innovation. Community. Security.