Tezos_alpha_test_helpers.ScenarioThis module centralises all modules related to Scenario writing and execution. Most scenario tests would use most if not all of them, so they only need to open Scenario.
include module type of struct include Scenario_base endUsual threaded state for the tests. Contains the current block and the known State.t
type t_incr = Incremental.t * State.tThreaded state when constructing a block step by step in incremental mode. The operation metadata list is built as operations are getting applied.
val log :
?level:Tezt_core.Cli.Logs.level ->
?color:Tezt_core.Log.Color.t ->
('a, Stdlib.Format.formatter, unit, ('b, 'b) Scenario_dsl.scenarios)
Stdlib.format4 ->
'aval set_baker : ?min_round:int -> string -> (t, t) Scenario_dsl.scenariosSets the de facto baker for all future blocks
val exclude_bakers : string list -> (t, t) Scenario_dsl.scenariosExclude a list of delegates from baking
val set_payload_round : int option -> (t, t) Scenario_dsl.scenariosval set_baked_round :
?payload_round:int ->
int ->
(t, t) Scenario_dsl.scenariosval unset_baking_policy : (t, t) Scenario_dsl.scenariosUnsets the baking policy, it returns to default (By_round 0)
val snapshot_balances :
Tezos_base.TzPervasives.String.Map.key ->
Tezos_base.TzPervasives.String.Map.key list ->
(t, t) Scenario_dsl.scenariosCreates 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
val check_snapshot_balances :
?f:
(name:Tezos_base.TzPervasives.String.Map.key ->
old_balance:State_account.balance ->
new_balance:State_account.balance ->
(unit, Tezos_base.TzPervasives.tztrace) Stdlib.result Lwt.t) ->
Tezos_base.TzPervasives.String.Map.key ->
(t, t) Scenario_dsl.scenariosCheck balances against a previously defined snapshot
val save_current_rate : (t, t) Scenario_dsl.scenariosSave the current issuance rate for future use
val check_rate_evolution :
(Q.t -> Q.t -> bool) ->
(t, t) Scenario_dsl.scenariosCheck 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 ->
(unit, Tezos_base.TzPervasives.tztrace) Stdlib.result Lwt.t) ->
('a -> 'b Tezos_base.TzPervasives.tzresult Lwt.t) ->
'a ->
'a Tezos_base.TzPervasives.tzresult Lwt.tval check_fail_and_rollback :
?loc:string ->
expected_error:
('a ->
Tezos_base.TzPervasives.tztrace ->
(unit, Tezos_base.TzPervasives.tztrace) Stdlib.result Lwt.t) ->
('a, 'b) Scenario_dsl.single_scenario ->
'a ->
'a Tezos_base.TzPervasives.tzresult Lwt.tval assert_failure :
?loc:string ->
expected_error:
('a ->
Tezos_base.TzPervasives.tztrace ->
(unit, Tezos_base.TzPervasives.tztrace) Stdlib.result Lwt.t) ->
('a, 'b) Scenario_dsl.scenarios ->
('a, 'a) Scenario_dsl.scenariosUseful 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.scenariosCheck a scenario does not fail, and rolls back to before the assert
val assert_failure_in_check_snapshot_balances :
loc:string ->
?f:
(name:Tezos_base.TzPervasives.String.Map.key ->
old_balance:State_account.balance ->
new_balance:State_account.balance ->
(unit, Tezos_base.TzPervasives.tztrace) Stdlib.result Lwt.t) ->
Tezos_base.TzPervasives.String.Map.key ->
(t, t) Scenario_dsl.scenariosval loop :
int ->
('a, 'a) Scenario_dsl.scenarios ->
('a, 'a) Scenario_dsl.scenariosLoop
val loop_action :
int ->
('a -> 'a Tezos_base.TzPervasives.tzresult Lwt.t) ->
('a, 'a) Scenario_dsl.scenariosval check_balance_field :
?loc:string ->
Tezos_base.TzPervasives.String.Map.key ->
[< `Bonds
| `Liquid
| `Pseudotokens
| `Staked
| `Total
| `Unstaked_finalizable
| `Unstaked_frozen_total ] ->
Tezos_protocol_alpha.Protocol.Alpha_context.Tez.t ->
(t, t) Scenario_dsl.scenariosCheck a specific balance field for a specific account is equal to a specific amount
val assert_failure_in_check_balance_field :
loc:string ->
Tezos_base.TzPervasives.String.Map.key ->
[< `Bonds
| `Liquid
| `Pseudotokens
| `Staked
| `Total
| `Unstaked_finalizable
| `Unstaked_frozen_total ] ->
Tezos_protocol_alpha.Protocol.Alpha_context.Tez.t ->
(t, t) Scenario_dsl.scenariosval check_balance_fields :
?loc:string ->
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 ->
?unstaked_finalizable:Tezos_alpha_test_helpers.State_account.Tez.t ->
unit ->
(t, t) Scenario_dsl.scenariosval with_metadata :
(Block.full_metadata -> ('a * State.t) -> 'b) ->
('a * State.t) ->
'bval exec_metadata :
(Block.full_metadata ->
('a * State.t) ->
(unit, Tezos_base.TzPervasives.tztrace) Stdlib.result Lwt.t) ->
('a * State.t, 'a * State.t) Scenario_dsl.scenariosinclude module type of struct include Scenario_op endval normalize_parameters :
Adaptive_issuance_helpers.staking_parameters ->
State.t ->
Adaptive_issuance_helpers.staking_parametersval set_delegate_params :
string ->
Adaptive_issuance_helpers.staking_parameters ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenariosSet delegate parameters for the given delegate
val add_account :
?algo:Signature.algo ->
Tezos_base.TzPervasives.String.Map.key ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenariosAdd a new account with the given name
val reveal :
string ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenariosReveal operation
val transfer :
Tezos_base.TzPervasives.String.Map.key ->
Tezos_base.TzPervasives.String.Map.key ->
Tez_helpers.Ez_tez.tez_quantity ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenariosTransfer from src to dst
val current_cycle :
Block.block ->
Tezos_alpha_test_helpers.State_account.Cycle.cycleval set_delegate :
Tezos_base.TzPervasives.String.Map.key ->
Tezos_base.TzPervasives.String.t option ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenariosSet delegate for src. If delegate_name_opt = None, then unset current delegate
val stake :
Tezos_base.TzPervasives.String.Map.key ->
Tez_helpers.Ez_tez.tez_quantity ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenariosStake operation
val unstake :
Tezos_base.TzPervasives.String.Map.key ->
Tez_helpers.Ez_tez.tez_quantity ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenariosunstake operation
val finalize_unstake :
Tezos_base.TzPervasives.String.Map.key ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenariosfinalize unstake operation
val update_consensus_key_ :
?proof_signer:string ->
?force_no_signer:bool ->
ck_name:string ->
string ->
(Block.block * State.t) ->
(State.t * Tezos_protocol_alpha.Protocol.Alpha_context.packed_operation list,
Tezos_base.TzPervasives.tztrace)
Stdlib.result
Lwt.tval update_consensus_key :
?proof_signer:string ->
?force_no_signer:bool ->
ck_name:string ->
string ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenariosval update_companion_key_ :
?proof_signer:string ->
?force_no_signer:bool ->
ck_name:string ->
string ->
(Block.block * State.t) ->
(State.t * Tezos_protocol_alpha.Protocol.Alpha_context.packed_operation list,
Tezos_base.TzPervasives.tztrace)
Stdlib.result
Lwt.tval update_companion_key :
?proof_signer:string ->
?force_no_signer:bool ->
ck_name:string ->
string ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenariosval check_pending_slashings :
loc:string ->
(Block.t * State.t) ->
unit Tezos_base.TzPervasives.tzresult Lwt.tval order_attestations :
correct_order:bool ->
'a Tezos_raw_protocol_alpha__Alpha_context.operation ->
'a Tezos_raw_protocol_alpha__Alpha_context.operation ->
'a Tezos_raw_protocol_alpha__Alpha_context.operation
* 'a Tezos_raw_protocol_alpha__Alpha_context.operationDouble attestation helpers
val op_double_attestation :
?correct_order:bool ->
Tezos_protocol_alpha.Protocol.Alpha_context.Kind.attestation
Tezos_protocol_alpha.Protocol.Alpha_context.Operation.t ->
Tezos_protocol_alpha.Protocol.Alpha_context.Kind.attestation
Tezos_protocol_alpha.Protocol.Alpha_context.Operation.t ->
Context.t ->
Tezos_protocol_alpha.Protocol.Alpha_context.Operation.packedval op_double_preattestation :
?correct_order:bool ->
Tezos_protocol_alpha.Protocol.Alpha_context.Kind.preattestation
Tezos_protocol_alpha.Protocol.Alpha_context.Operation.t ->
Tezos_protocol_alpha.Protocol.Alpha_context.Kind.preattestation
Tezos_protocol_alpha.Protocol.Alpha_context.Operation.t ->
Context.t ->
Tezos_protocol_alpha.Protocol.Alpha_context.Operation.packedval order_block_hashes :
correct_order:bool ->
Tezos_protocol_alpha.Protocol.Alpha_context.Block_header.block_header ->
Tezos_protocol_alpha.Protocol.Alpha_context.Block_header.block_header ->
Tezos_protocol_alpha.Protocol.Alpha_context.Block_header.block_header
* Tezos_protocol_alpha.Protocol.Alpha_context.Block_header.block_headerval op_double_baking :
?correct_order:bool ->
Tezos_protocol_alpha.Protocol.Alpha_context.Block_header.block_header ->
Tezos_protocol_alpha.Protocol.Alpha_context.Block_header.block_header ->
Context.t ->
Tezos_protocol_alpha.Protocol.Alpha_context.Operation.packedval double_bake_op :
string list ->
(Block.t * State.t) ->
(Block.t * State.t, Tezos_base.TzPervasives.tztrace) Stdlib.result Lwt.tdouble_bake_op delegate_names (block, state) performs a double baking with the given delegate names. The first delegate in the list bakes the new main branch. All delegates (including the first) will bake two other blocks at the same level/different round.
val double_bake :
string ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenariosval double_bake_many :
string list ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenariosval double_attest_op :
?other_bakers:(string * string) ->
op:
(manager_pkh:Tezos_alpha_test_helpers.Signature.Public_key_hash.t ->
attested_block:Block.t ->
('a Tezos_protocol_alpha.Protocol.Alpha_context.Kind.consensus
Tezos_protocol_alpha.Protocol.Alpha_context.operation,
Tezos_base.TzPervasives.tztrace)
Stdlib.result
Lwt.t) ->
op_evidence:
('a Tezos_protocol_alpha.Protocol.Alpha_context.Kind.consensus
Tezos_protocol_alpha.Protocol.Alpha_context.operation ->
'a Tezos_protocol_alpha.Protocol.Alpha_context.Kind.consensus
Tezos_protocol_alpha.Protocol.Alpha_context.operation ->
Context.t ->
Tezos_protocol_alpha.Protocol.Alpha_context.packed_operation) ->
kind:Tezos_protocol_alpha.Protocol.Misbehaviour_repr.kind ->
string list ->
(Block.t * State.t) ->
(Block.t * State.t, Tezos_base.TzPervasives.tztrace) Stdlib.result Lwt.tdouble_attest_op ?other_bakers ~op ~op_evidence ~kind delegate_names (block, state) performs a double (pre)attestation with the given delegate names. Starting at block level `n`, it creates two 2-block branches and all delegates will (pre)attest the two blocks at level `n+2`. other_bakers can be used to force using specific bakers to avoid reusing forbidden ones
val double_attest_ :
?other_bakers:(string * string) ->
string list ->
(Block.t * State.t) ->
(Block.t * State.t, Tezos_base.TzPervasives.tztrace) Stdlib.result Lwt.tval double_attest_many :
?other_bakers:(string * string) ->
string list ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenariosval double_attest :
?other_bakers:(string * string) ->
string ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenariosval double_preattest_ :
?other_bakers:(string * string) ->
string list ->
(Block.t * State.t) ->
(Block.t * State.t, Tezos_base.TzPervasives.tztrace) Stdlib.result Lwt.tval double_preattest_many :
?other_bakers:(string * string) ->
string list ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenariosval double_preattest :
?other_bakers:(string * string) ->
string ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenariosval cycle_from_level :
int32 ->
int32 ->
Tezos_alpha_test_helpers.State_account.Cycle.cycleval update_state_denunciation :
(Block.t * State.t) ->
State.double_signing_state ->
(State.t * bool, Tezos_base.TzPervasives.tztrace) Stdlib.result Lwt.tval make_denunciations_op :
?single:bool ->
?rev:bool ->
?filter:(State.double_signing_state -> bool) ->
(Block.t * State.t) ->
(State.t * Tezos_protocol_alpha.Protocol.Alpha_context.packed_operation list,
Tezos_base.TzPervasives.tztrace)
Stdlib.result
Lwt.tmake_denunciations_op ?single ?rev ?filter () denounces all double signers in the state. If single is set, only one denunciation is made. If rev is set, the denunciations are made in reverse order. If filter is set, only the double signers for which the filter returns true are denounced.
val make_denunciations :
?single:bool ->
?rev:bool ->
?filter:(State.double_signing_state -> bool) ->
unit ->
(Block.t * State.t, Scenario_base.t) Scenario_dsl.scenariosval add_account_with_funds :
?algo:Signature.algo ->
Tezos_base.TzPervasives.String.Map.key ->
funder:Tezos_base.TzPervasives.String.Map.key ->
Tez_helpers.Ez_tez.tez_quantity ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenariosCreate an account and give an initial balance funded by funder
val start_payload : (Scenario_base.t, Scenario_base.t) Scenario_dsl.scenariosval batch :
source:string ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenariosval add_batch_to_operations :
?mode_after:State.operation_mode ->
Scenario_base.t ->
State.t Tezos_base.TzPervasives.tzresult Lwt.tval end_batch :
?bake_after:bool ->
?mode_after:State.operation_mode ->
unit ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenariosinclude module type of struct include Scenario_dsl endtype ('input, 'output) scenarios = ('input, 'output) Scenario_dsl.scenarios = | Action : ('input ->
'output Tezos_base.TzPervasives.tzresult Lwt.t) -> ('input, 'output)
scenarios| Empty : ('t, 't) scenarios| Concat : (('a, 'b) scenarios * ('b, 'c) scenarios) -> ('a, 'c) scenarios| Branch : (('a, 'b) scenarios * ('a, 'b) scenarios) -> ('a, 'b) scenarios| Tag : string -> ('t, 't) scenarios| Slow : ('t, 't) scenariosA scenario is a succession of actions. We define a branching path as a way to create multiple tests from the same point. This allows easy compositionality of behaviors with minimal code sharing. The Tag allows to give meaningful identifiers to the branches. It is good practice to tag each case in a branch (it's not necessary, but since test names must be unique, at most one branch can remain unnamed, and even then it can create conflicting names.)
type ('input, 'output) single_scenario =
('input, 'output) Scenario_dsl.single_scenario =
| End_scenario : ('t, 't) single_scenario| Cons : (('input ->
't Tezos_base.TzPervasives.tzresult Lwt.t)
* ('t, 'output) single_scenario) -> ('input, 'output) single_scenarioUnfolded scenario type
val cat_ss :
'a 'b 'c. ('a, 'b) single_scenario ->
('b, 'c) single_scenario ->
('a, 'c) single_scenarioval unfold_scenarios :
'input 'output. ('input, 'output) scenarios ->
(('input, 'output) single_scenario * string list * bool) listval run_scenario :
'input 'output. ('input, 'output) single_scenario ->
'input ->
'output Tezos_base.TzPervasives.tzresult Lwt.ttype test_closure = string * bool * (Tezt_tezos.Protocol.t -> unit Lwt.t)val unfolded_to_test :
((unit, unit) single_scenario * string list * bool) ->
test_closureval register_test : __FILE__:string -> tags:string list -> test_closure -> unitval register_tests :
__FILE__:string ->
tags:string list ->
test_closure list ->
unitUseful aliases and operators
val noop : ('a, 'a) scenariosval no_tag : ('a, 'a) scenariosContinuation connector: execute a then b
Branching connector: creates two tests with different execution paths
Branching combinator: creates a test path for each element in the list.
val end_test : ('a, unit) scenariosEnds the test. Dump the state, returns unit
val tests_of_scenarios :
(string * (unit, 't) scenarios) list ->
test_closure listTransforms scenarios into tests
val exec :
('a -> 'b Tezos_base.TzPervasives.tzresult Lwt.t) ->
('a, 'b) scenariosArbitrary execution
val exec_state :
(('a * 'b) -> ('c, Tezos_base.TzPervasives.tztrace) Stdlib.result Lwt.t) ->
('a * 'b, 'a * 'c) scenariosExecute a function that does not modify the block, only the state
val exec_unit :
('a -> (unit, Tezos_base.TzPervasives.tztrace) Stdlib.result Lwt.t) ->
('a, 'a) scenariosExecute a function that does not modify neither the block nor the state. Usually used for checks/asserts
fold f l folds f over l, fails on empty list
fold_tag f l folds f over l, l has a tag for each of its elements. Fails on empty list.
fold_tag_f f tag l folds f over l, tag returns a tag for each element of l. Fails on empty list.
include module type of struct include Scenario_begin endReturns when the number of bootstrap accounts created by Context.init_n n is not equal to n
val start :
constants:starter_constants ->
(unit, Scenario_constants.constants) Scenario_dsl.scenariosval start_with :
constants:Scenario_constants.constants ->
(unit, Scenario_constants.constants) Scenario_dsl.scenariosval start_with_list :
constants:(string * Scenario_constants.constants) list ->
(unit, Scenario_constants.constants) Scenario_dsl.scenariosval init_constants :
?default:starter_constants ->
?reward_per_block:int64 ->
?deactivate_dynamic:bool ->
?blocks_per_cycle:int32 ->
?delegate_parameters_activation_delay:int ->
unit ->
(unit, Scenario_constants.constants) Scenario_dsl.scenariosInitializes the constants for testing, with well chosen default values. Recommended over start or start_with
val begin_test :
?delegates_with_algo:
(Tezos_base.TzPervasives.String.Map.key * Signature.algo) list ->
?algo:Signature.algo ->
?burn_rewards:bool ->
?force_attest_all:bool ->
?force_preattest_all:bool ->
?check_finalized_every_block:
(Block.full_metadata ->
(Block.t * State.t) ->
unit Tezos_base.TzPervasives.tzresult Lwt.t)
list ->
?disable_default_checks:bool ->
Tezos_base.TzPervasives.String.Map.key list ->
(Scenario_constants.constants, Scenario_base.t) Scenario_dsl.scenariosInitialize the test, given some initial parameters. algo defines the algorithm used for the delegates_name_list. If not set, a random algorithm is selected for each. To use a different algorithm for each delegate, use delegates_with_algo
include module type of struct include Scenario_constants endtype constants = Constants_helpers.tval set :
('a -> constants -> constants) ->
'a ->
(constants, constants) Scenario_dsl.scenariosval set_opt :
('a -> constants -> constants) ->
'a option ->
(constants, constants) Scenario_dsl.scenariosval sets :
('a -> constants -> constants) ->
(string * 'a) list ->
(constants, constants) Scenario_dsl.scenariosval sets_f :
('a -> constants -> constants) ->
('a -> string) ->
'a list ->
(constants, constants) Scenario_dsl.scenariosval branch_flag :
(bool -> constants -> constants) ->
(constants, constants) Scenario_dsl.scenariosval branch_flags :
(bool -> constants -> constants) list ->
(constants, constants) Scenario_dsl.scenariosval sets_int :
(int -> constants -> constants) ->
int list ->
(constants, constants) Scenario_dsl.scenariosinclude module type of struct include Scenario_bake endval apply_end_cycle :
Tezos_alpha_test_helpers.State_account.Cycle.t ->
Block.t ->
Block.block ->
State.t ->
State.t Tezos_base.TzPervasives.tzresult Lwt.tApplies when baking the last block of a cycle
val apply_new_cycle :
Tezos_alpha_test_helpers.State_account.Cycle.cycle ->
State.t ->
State.tApplies when baking the first block of a cycle. Technically nothing special happens, but we need to update the unslashable unstakes since it's done lazily
val check_all_balances :
'a ->
(Block.t * State.t) ->
unit Tezos_base.TzPervasives.tzresult Lwt.tAfter baking and applying rewards in state
val check_misc :
'a ->
(Block.t * State.t) ->
unit Tezos_base.TzPervasives.tzresult Lwt.tMisc checks at block end
val check_issuance_rpc :
'a ->
(Block.t * 'b) ->
unit Tezos_base.TzPervasives.tzresult Lwt.tval check_ai_launch_cycle_is_zero :
loc:string ->
Block.t ->
(unit, Tezos_base.TzPervasives.tztrace) Stdlib.result Lwt.tval apply_all_pending_operations_ :
Scenario_base.t_incr ->
Scenario_base.t_incr Tezos_base.TzPervasives.tzresult Lwt.tApply all operations pending in the state. It is imperative that the list of pending operations in the state is empty before finalizing the block, either manually, or by calling this function.
val finalize_payload_ :
?payload_round:int ->
?baker:string ->
Scenario_base.t ->
Scenario_base.t_incr Tezos_base.TzPervasives.tzresult Lwt.tfinalize the payload of the next block. Can start including preattestations.
val finalize_payload :
?payload_round:int ->
?baker:string ->
unit ->
(Scenario_base.t, Scenario_base.t_incr) Scenario_dsl.scenariosval finalize_block_ :
Scenario_base.t_incr ->
Scenario_base.t Tezos_base.TzPervasives.tzresult Lwt.tval finalize_block :
(Scenario_base.t_incr, Scenario_base.t) Scenario_dsl.scenariosval bake :
?baker:string ->
Scenario_base.t ->
Scenario_base.t Tezos_base.TzPervasives.tzresult Lwt.tBake a block, with the given baker and the given operations.
val bake_until_level :
target_level:int ->
Scenario_base.t ->
Scenario_base.t Tezos_base.TzPervasives.tzresult Lwt.tval bake_until :
target_cycle:int ->
[< `Cycle_end | `Cycle_end_but_one | `New_cycle ] ->
Scenario_base.t ->
Scenario_base.t Tezos_base.TzPervasives.tzresult Lwt.tval bake_until_next_cycle :
Scenario_base.t ->
Scenario_base.t Tezos_base.TzPervasives.tzresult Lwt.tBake until a cycle is reached, using bake instead of Block.bake
val bake_until_dawn_of_next_cycle :
Scenario_base.t ->
Scenario_base.t Tezos_base.TzPervasives.tzresult Lwt.tBake all the remaining blocks of the current cycle
val bake_until_next_cycle_end_but_one :
Scenario_base.t ->
Scenario_base.t Tezos_base.TzPervasives.tzresult Lwt.tval next_block_ :
Scenario_base.t ->
Scenario_base.t Tezos_base.TzPervasives.tzresult Lwt.tBake a single block
val next_block : (Scenario_base.t, Scenario_base.t) Scenario_dsl.scenariosval next_block_with_baker :
string ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenariosBake a single block with a specific baker
val next_cycle_ :
Scenario_base.t ->
Scenario_base.t Tezos_base.TzPervasives.tzresult Lwt.tBake until the end of a cycle
val next_cycle : (Scenario_base.t, Scenario_base.t) Scenario_dsl.scenariosBake until the end of a cycle
val dawn_of_next_cycle :
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenariosval exec_op :
((Block.t * 'a) ->
(State.t
* Tezos_protocol_alpha.Protocol.Alpha_context.packed_operation list,
Tezos_base.TzPervasives.tztrace)
Stdlib.result
Lwt.t) ->
(Block.t * 'a, Scenario_base.t) Scenario_dsl.scenariosExecutes an operation: f should return a new state and a list of operations, which are then applied
val wait_n_cycles :
int ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenariosWaiting functions
val wait_n_blocks :
int ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenariosval wait_cycle_f_es :
(Scenario_base.t ->
Scenario_base.t ->
bool Tezos_base.TzPervasives.tzresult Lwt.t) ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenariosval wait_cycle_f :
(Scenario_base.t -> Scenario_base.t -> bool) ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenariosWaits until condition init_t current_t is fulfilled. It is checked on the first block of every cycle. If it returns false, another cycle is baked, until it succeeds.
val wait_cycle_until :
([< `And of 'a * 'a
| `delegate_parameters_activation
| `right_before_delegate_parameters_activation ] as 'a) ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenariosWait until we are in a cycle satisfying the given condition. Fails if AI_activation is requested and AI is not set to be activated in the future.
val wait_delegate_parameters_activation :
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenarioswait delegate_parameters_activation_delay cycles
val wait_n_cycles_f_es :
(Scenario_base.t -> int Tezos_base.TzPervasives.tzresult Lwt.t) ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenariosval wait_n_cycles_f :
(Scenario_base.t -> int) ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenariosinclude module type of struct include Scenario_attestation endval update_activity : string -> Block.block -> State.t -> State.tval string_of_kind : kind -> string--- Attestations ---
val check_attestation_metadata :
?check_not_found:bool ->
kind:kind ->
Tezos_alpha_test_helpers.Signature.Public_key_hash.t ->
Tezos_alpha_test_helpers.Signature.Public_key_hash.t ->
Block.full_metadata ->
Scenario_base.t ->
unit Tezos_base.TzPervasives.tzresult Lwt.tval check_attestation_aggregate_metadata :
?check_not_found:bool ->
kind:kind ->
?expect_same_order:bool ->
Tezos_protocol_alpha.Protocol.Alpha_context.Consensus_key.t list ->
Block.full_metadata ->
Scenario_base.t ->
unit Tezos_base.TzPervasives.tzresult Lwt.tval check_attestation_rewards :
?check_not_found:bool ->
string ->
Block.full_metadata ->
Scenario_base.t ->
unit Tezos_base.TzPervasives.tzresult Lwt.tval check_missed_attestation_rewards :
string ->
?check_not_found:bool ->
Block.full_metadata ->
Scenario_base.t ->
unit Tezos_base.TzPervasives.tzresult Lwt.tval attest_with :
?dal_content:Z.t ->
string ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenariosval attest_aggreg_with :
?delegates_with_dal:(string * Z.t) list ->
string list ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenarios(tz4 only) Creates an aggregated attestation from the attestations of the given delegates. Fails if one of the delegates has no slot for the given block, or if one of the delegates' consensus key is not a tz4
val key_for_metadata_of_delegate_rights :
Tezos_protocol_plugin_alpha.RPC.Attestation_rights.delegate_rights ->
Tezos_protocol_alpha.Protocol.Alpha_context.Consensus_key.tval attest_with_all_ :
Scenario_base.t ->
Scenario_base.t Tezos_base.TzPervasives.tzresult Lwt.tval attest_with_all : (Scenario_base.t, Scenario_base.t) Scenario_dsl.scenarios--- Preattestations ---
val make_fake_block :
?payload_round:int ->
Incremental.incremental ->
(Block.t, Tezos_base.TzPervasives.tztrace) Stdlib.result Lwt.tval preattest_with :
?payload_round:int ->
string ->
(Scenario_base.t_incr, Scenario_base.t_incr) Scenario_dsl.scenariosval preattest_aggreg_with :
?payload_round:int ->
string list ->
(Scenario_base.t_incr, Scenario_base.t_incr) Scenario_dsl.scenarios(tz4 only) Creates an aggregated preattestation from the preattestations of the given delegates. Fails if one of the delegates has no slot for the given block, or if one of the delegates' consensus key is not a tz4
val preattest_with_all_ :
?payload_round:int ->
Scenario_base.t_incr ->
Scenario_base.t_incr Tezos_base.TzPervasives.tzresult Lwt.t