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.
val set_delegate_params :
string ->
Adaptive_issuance_helpers.staking_parameters ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenarios
Set delegate parameters for the given delegate
val add_account :
string ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenarios
Add a new account with the given name
val reveal :
string ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenarios
Reveal operation
val transfer :
Mavryk_base.TzPervasives.String.Map.key ->
Mavryk_base.TzPervasives.String.Map.key ->
Tez_helpers.Ez_tez.tez_quantity ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenarios
Transfer from src to dst
val set_delegate :
Mavryk_base.TzPervasives.String.Map.key ->
Mavryk_base.TzPervasives.String.t option ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenarios
Set delegate for src. If delegate_name_opt = None
, then unset current delegate
val stake :
Mavryk_base.TzPervasives.String.Map.key ->
Tez_helpers.Ez_tez.tez_quantity ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenarios
Stake operation
val unstake :
Mavryk_base.TzPervasives.String.Map.key ->
Tez_helpers.Ez_tez.tez_quantity ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenarios
unstake operation
val finalize_unstake :
Mavryk_base.TzPervasives.String.Map.key ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenarios
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 op_double_attestation :
?correct_order:bool ->
Mavryk_protocol_alpha.Protocol.Alpha_context.Kind.attestation
Mavryk_protocol_alpha.Protocol.Alpha_context.Operation.t ->
Mavryk_protocol_alpha.Protocol.Alpha_context.Kind.attestation
Mavryk_protocol_alpha.Protocol.Alpha_context.Operation.t ->
Context.t ->
Mavryk_protocol_alpha.Protocol.Alpha_context.Operation.packed
val op_double_preattestation :
?correct_order:bool ->
Mavryk_protocol_alpha.Protocol.Alpha_context.Kind.preattestation
Mavryk_protocol_alpha.Protocol.Alpha_context.Operation.t ->
Mavryk_protocol_alpha.Protocol.Alpha_context.Kind.preattestation
Mavryk_protocol_alpha.Protocol.Alpha_context.Operation.t ->
Context.t ->
Mavryk_protocol_alpha.Protocol.Alpha_context.Operation.packed
val order_block_hashes :
correct_order:bool ->
Mavryk_protocol_alpha.Protocol.Alpha_context.Block_header.block_header ->
Mavryk_protocol_alpha.Protocol.Alpha_context.Block_header.block_header ->
Mavryk_protocol_alpha.Protocol.Alpha_context.Block_header.block_header
* Mavryk_protocol_alpha.Protocol.Alpha_context.Block_header.block_header
val op_double_baking :
?correct_order:bool ->
Mavryk_protocol_alpha.Protocol.Alpha_context.Block_header.block_header ->
Mavryk_protocol_alpha.Protocol.Alpha_context.Block_header.block_header ->
Context.t ->
Mavryk_protocol_alpha.Protocol.Alpha_context.Operation.packed
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 :
string ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenarios
val double_bake_many :
string list ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenarios
val double_attest_op :
?other_bakers:(string * string) ->
op:
(delegate:Mavryk_base.TzPervasives.Signature.Public_key_hash.t ->
Block.t ->
('a Mavryk_protocol_alpha.Protocol.Alpha_context.Kind.consensus
Mavryk_protocol_alpha.Protocol.Alpha_context.operation,
Mavryk_base.TzPervasives.tztrace)
Stdlib.result
Lwt.t) ->
op_evidence:
('a Mavryk_protocol_alpha.Protocol.Alpha_context.Kind.consensus
Mavryk_protocol_alpha.Protocol.Alpha_context.operation ->
'a Mavryk_protocol_alpha.Protocol.Alpha_context.Kind.consensus
Mavryk_protocol_alpha.Protocol.Alpha_context.operation ->
Context.t ->
Mavryk_protocol_alpha.Protocol.Alpha_context.packed_operation) ->
kind:Mavryk_protocol_alpha.Protocol.Misbehaviour_repr.kind ->
string list ->
(Block.t * State.t) ->
(Block.t * State.t, Mavryk_base.TzPervasives.tztrace) Stdlib.result Lwt.t
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 pct_from_kind :
Block.t ->
Mavryk_protocol_alpha.Protocol.Misbehaviour_repr.kind ->
int
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
val add_account_with_funds :
Mavryk_base.TzPervasives.String.Map.key ->
funder:Mavryk_base.TzPervasives.String.Map.key ->
Tez_helpers.Ez_tez.tez_quantity ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenarios
Create an account and give an initial balance funded by funder