package octez-protocol-alpha-libs
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=ddfb5076eeb0b32ac21c1eed44e8fc86a6743ef18ab23fff02d36e365bb73d61
sha512=d22a827df5146e0aa274df48bc2150b098177ff7e5eab52c6109e867eb0a1f0ec63e6bfbb0e3645a6c2112de3877c91a17df32ccbff301891ce4ba630c997a65
doc/octez-protocol-alpha-libs.test-helpers/Tezos_alpha_test_helpers/Scenario_op/index.html
Module Tezos_alpha_test_helpers.Scenario_op
Source
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
Add a new account with the given name
Reveal 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.scenarios
Transfer from src to dst
val set_delegate :
Tezos_base.TzPervasives.String.Map.key ->
Tezos_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 :
Tezos_base.TzPervasives.String.Map.key ->
Tez_helpers.Ez_tez.tez_quantity ->
(Scenario_base.t, Scenario_base.t) Scenario_dsl.scenarios
Stake operation
val unstake :
Tezos_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 :
Tezos_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 Tezos_base.TzPervasives.tzresult Lwt.t
val 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.operation
Double 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.packed
val 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.packed
val 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_header
val double_bake_op :
string list ->
(Block.t * State.t) ->
(Block.t * State.t, Tezos_base.TzPervasives.tztrace) 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
val double_attest_op :
?other_bakers:(string * string) ->
op:
(delegate:Tezos_base.TzPervasives.Signature.Public_key_hash.t ->
Block.t ->
('a Tezos_protocol_alpha.Protocol.Alpha_context.Kind.consensus
Tezos_protocol_alpha.Protocol.Alpha_context.operation,
Tezos_base.TzPervasives.tztrace)
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) 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_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_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 update_state_denunciation :
(Block.t * State.t) ->
State.double_signing_state ->
(State.t * bool, Tezos_base.TzPervasives.tztrace) result Lwt.t
val 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)
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 :
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.scenarios
Create an account and give an initial balance funded by funder