package octez-protocol-alpha-libs

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

Module Tezos_alpha_test_helpers.Scenario_baseSource

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

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

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

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

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

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

Sourceval set_baker : string -> (t, t) Scenario_dsl.scenarios

Sets the de facto baker for all future blocks

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

Exclude a list of delegates from baking

Sourceval 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

Sourceval save_current_rate : (t, t) Scenario_dsl.scenarios

Save the current issuance rate for future use

Sourceval 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

Sourceval check_failure_aux : ?loc:string -> ?expected_error:('a -> Tezos_base.TzPervasives.tztrace) -> ('a -> 'b Tezos_base.TzPervasives.tzresult Lwt.t) -> 'a -> 'a Tezos_base.TzPervasives.tzresult Lwt.t
Sourceval check_fail_and_rollback : ?loc:string -> ?expected_error:('a -> Tezos_base.TzPervasives.tztrace) -> ('a, 'b) Scenario_dsl.single_scenario -> 'a -> 'a Tezos_base.TzPervasives.tzresult Lwt.t
Sourceval assert_failure : ?loc:string -> ?expected_error:('a -> Tezos_base.TzPervasives.tztrace) -> ('a, 'b) Scenario_dsl.scenarios -> ('a, 'a) 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

Sourceval 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

Sourceval loop : int -> ('a, 'a) Scenario_dsl.scenarios -> ('a, 'a) Scenario_dsl.scenarios

Loop

Sourceval loop_action : int -> ('a -> 'a Tezos_base.TzPervasives.tzresult Lwt.t) -> ('a, 'a) Scenario_dsl.scenarios
Sourceval 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

Sourceval check_balance_fields : Tezos_base.TzPervasives.String.Map.key -> liquid:Tezos_protocol_alpha.Protocol.Alpha_context.Tez.t -> staked:Tezos_protocol_alpha.Protocol.Alpha_context.Tez.t -> ?unstaked_frozen_total:Tezos_alpha_test_helpers.State_account.Tez.t -> unit -> (t, t) Scenario_dsl.scenarios
OCaml

Innovation. Community. Security.