Module Mavryk_alpha_test_helpers.Scenario_op

This module gathers many protocol operations in the form of scenarios. This includes (but is not limited to) transfers and such (stake, unstake...), as well as various ways to forge double signings.

Set delegate parameters for the given delegate

Add a new account with the given name

Reveal operation

Transfer from src to dst

Set delegate for src. If delegate_name_opt = None, then unset current delegate

Stake operation

unstake operation

finalize unstake operation

val check_pending_slashings : loc:string -> (Block.t * State.t) -> unit Mavryk_base.TzPervasives.tzresult Lwt.t
val order_attestations : correct_order:bool -> 'a Mavryk_raw_protocol_alpha__Alpha_context.operation -> 'a Mavryk_raw_protocol_alpha__Alpha_context.operation -> 'a Mavryk_raw_protocol_alpha__Alpha_context.operation * 'a Mavryk_raw_protocol_alpha__Alpha_context.operation

Double attestation helpers

val double_bake_op : string list -> (Block.t * State.t) -> (Block.t * State.t, Mavryk_base.TzPervasives.tztrace) Stdlib.result Lwt.t

double_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_many : string list -> (Scenario_base.t, Scenario_base.t) Scenario_dsl.scenarios

double_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, Mavryk_base.TzPervasives.tztrace) Stdlib.result Lwt.t
val double_attest_many : ?other_bakers:(string * string) -> string list -> (Scenario_base.t, Scenario_base.t) Scenario_dsl.scenarios
val double_attest : ?other_bakers:(string * string) -> string -> (Scenario_base.t, Scenario_base.t) Scenario_dsl.scenarios
val double_preattest_ : ?other_bakers:(string * string) -> string list -> (Block.t * State.t) -> (Block.t * State.t, Mavryk_base.TzPervasives.tztrace) Stdlib.result Lwt.t
val double_preattest_many : ?other_bakers:(string * string) -> string list -> (Scenario_base.t, Scenario_base.t) Scenario_dsl.scenarios
val double_preattest : ?other_bakers:(string * string) -> string -> (Scenario_base.t, Scenario_base.t) Scenario_dsl.scenarios
val cycle_from_level : int32 -> int32 -> Mavryk_alpha_test_helpers.State_account.Cycle.cycle
val get_pending_slashed_pct_for_delegate : (Block.t * State.t) -> Mavryk_base.TzPervasives.Signature.Public_key_hash.t -> int
val update_state_denunciation : (Block.t * State.t) -> State.double_signing_state -> (State.t * bool, Mavryk_base.TzPervasives.tztrace) Stdlib.result Lwt.t
val make_denunciations_op : ?single:bool -> ?rev:bool -> ?filter:(State.double_signing_state -> bool) -> (Block.t * State.t) -> (State.t * Mavryk_protocol_alpha.Protocol.Alpha_context.packed_operation list, Mavryk_base.TzPervasives.tztrace) Stdlib.result Lwt.t

make_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.scenarios

Create an account and give an initial balance funded by funder