package tezt-tezos

  1. Overview
  2. Docs
type t

A representation of a consensus operation.

val dal_attestation : attestation:bool array -> level:int -> slot:int -> t

dal_attestation ~attestation ~level ~slot crafts a slot attestation operation to attest at level slot headers published at level level - attestation_lag. For each slot, the value of the booleans indicates whether the data is deemed available.

val consensus : use_legacy_name:bool -> kind:consensus_kind -> slot:int -> level:int -> round:int -> block_payload_hash:string -> t

consensus ~kind ~use_legacy_name ~level ~round ~slot ~block_payload_hash crafts a consensus operation with the kind at level on the round with the slot and block_payload_hash. If use_legacy_name is set, the kind field in the crafted JSON will be "(pre)endorsement" instead of "(pre)attestation".

val preattestation : use_legacy_name:bool -> slot:int -> level:int -> round:int -> block_payload_hash:string -> t

preattestation ?use_legacy_name ~level ~round ~slot ~block_payload_hash crafts a preattestation operation at level on the round with the slot and block_payload_hash. If use_legacy_name is set, the kind field in the crafted JSON will be "preendorsement" instead of "preattestation".

val attestation : use_legacy_name:bool -> slot:int -> level:int -> round:int -> block_payload_hash:string -> t

attestation ?use_legacy_name ~level ~round ~slot ~block_payload_hash crafts an attestation operation at level on the round with the slot and block_payload_hash. If use_legacy_name is set, the kind field in the crafted JSON will be "endorsement" instead of "attestation".

val kind_to_string : consensus_kind -> bool -> string

kind_to_string kind use_legacy_name return the name of the kind. If use_legacy_name is set, the name corresponding to the kind will be "(pre)endorsement" instead of "(pre)attestation".

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

operation constructs an operation from a consensus operation. the client is used to fetch the branch and the chain_id.

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

A wrapper for inject with consensus 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 chain_id.

val get_slots : level:int -> Client.t -> Tezt_wrapper.JSON.t Lwt.t

Retrieves the attestation slots at level by calling the GET /chains/<chain>/blocks/<block>/helpers/validators RPC.

val first_slot : slots_json:Tezt_wrapper.JSON.t -> Account.key -> int

Returns the first slot of the provided delegate in the slots_json that describes all attestation rights at some level.

Causes the test to fail if the delegate is not found.

val get_block_payload_hash : Client.t -> string Lwt.t

Calls the GET /chains/<chain>/blocks/<block>/header RPC and extracts the head block's payload hash from the result.

OCaml

Innovation. Community. Security.