package octez-protocol-alpha-libs

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

This module gathers the basic operations used in test scenarios. This includes starting a scenario, baking, checking and manipulating the state, and various wait functions

type Tezos_base.TzPervasives.error +=
  1. | Unexpected_error

For assert_failure, when expected error does not match the actual error.

type Tezos_base.TzPervasives.error +=
  1. | Unexpected_success

For assert_failure, when scenario actually succeeds when expected to fail.

type t = Block.t * State.t

Usual threaded state for the tests. Contains the current block, pending operations and the known State.t

val log : ?level:Tezt_core.Cli.Logs.level -> ?color:Tezt_core.Log.Color.t -> ('a, Format.formatter, unit, ('b, 'b) Scenario_dsl.scenarios) format4 -> 'c
val set_baker : string -> (t, t) Scenario_dsl.scenarios

Sets the de facto baker for all future blocks

val exclude_bakers : string list -> (t, t) Scenario_dsl.scenarios

Exclude a list of delegates from baking

val unset_baking_policy : (t, t) Scenario_dsl.scenarios

Unsets the baking policy, it returns to default (By_round 0)

Creates a snapshot of the current balances for the given account names. Can be used to check that balances at point A and B in the execution of a test are the same (either nothing happened, or a succession of actions resulted in getting the same values as before

Check balances against a previously defined snapshot

val save_current_rate : (t, t) Scenario_dsl.scenarios

Save the current issuance rate for future use

val check_rate_evolution : (Q.t -> Q.t -> bool) -> (t, t) Scenario_dsl.scenarios

Check that f saved_rate current_rate is true. f is typically a comparison function

val check_failure_aux : ?loc:string -> ?expected_error:('a -> Tezos_base.TzPervasives.tztrace) -> ('a0 -> 'b Tezos_base.TzPervasives.tzresult Lwt.t) -> 'a0 -> 'a0 Tezos_base.TzPervasives.tzresult Lwt.t
val check_fail_and_rollback : ?loc:string -> ?expected_error:('a -> Tezos_base.TzPervasives.tztrace) -> ('a0, 'b) Scenario_dsl.single_scenario -> 'a0 -> 'a0 Tezos_base.TzPervasives.tzresult Lwt.t
val assert_failure : ?loc:string -> ?expected_error:('a -> Tezos_base.TzPervasives.tztrace) -> ('a0, 'b) Scenario_dsl.scenarios -> ('a0, 'a0) Scenario_dsl.scenarios

Useful function to test expected failures: runs the given branch until it fails, then rollbacks to before execution. Fails if the given branch Succeeds

val assert_success : ?loc:string -> ('a, 'b) Scenario_dsl.scenarios -> ('a, 'a) Scenario_dsl.scenarios

Check a scenario does not fail, and rolls back to before the assert

val loop : int -> ('a, 'a) Scenario_dsl.scenarios -> ('a0, 'a1) Scenario_dsl.scenarios

Loop

val loop_action : int -> ('a -> 'a Tezos_base.TzPervasives.tzresult Lwt.t) -> ('a0, 'a1) Scenario_dsl.scenarios
val check_balance_field : Tezos_base.TzPervasives.String.Map.key -> [< `Bonds | `Liquid | `Staked | `Total | `Unstaked_finalizable | `Unstaked_frozen_total ] -> Tezos_protocol_alpha.Protocol.Alpha_context.Tez.t -> (t, t) Scenario_dsl.scenarios

Check a specific balance field for a specific account is equal to a specific amount

OCaml

Innovation. Community. Security.