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_opSource

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

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

Sourceval check_pending_slashings : loc:string -> (Block.t * State.t) -> unit Tezos_base.TzPervasives.tzresult Lwt.t
Sourceval 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

Sourceval 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
Sourceval 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
Sourceval 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
Sourceval 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.packed
Sourceval 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.

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

Sourceval double_attest_ : ?other_bakers:(string * string) -> string list -> (Block.t * State.t) -> (Block.t * State.t, Tezos_base.TzPervasives.tztrace) result Lwt.t
Sourceval double_attest_many : ?other_bakers:(string * string) -> string list -> (Scenario_base.t, Scenario_base.t) Scenario_dsl.scenarios
Sourceval double_attest : ?other_bakers:(string * string) -> string -> (Scenario_base.t, Scenario_base.t) Scenario_dsl.scenarios
Sourceval double_preattest_ : ?other_bakers:(string * string) -> string list -> (Block.t * State.t) -> (Block.t * State.t, Tezos_base.TzPervasives.tztrace) result Lwt.t
Sourceval double_preattest_many : ?other_bakers:(string * string) -> string list -> (Scenario_base.t, Scenario_base.t) Scenario_dsl.scenarios
Sourceval double_preattest : ?other_bakers:(string * string) -> string -> (Scenario_base.t, Scenario_base.t) Scenario_dsl.scenarios
Sourceval cycle_from_level : int32 -> int32 -> Tezos_alpha_test_helpers.State_account.Cycle.cycle
Sourceval pct_from_kind : Block.t -> Tezos_protocol_alpha.Protocol.Misbehaviour_repr.kind -> int
Sourceval get_pending_slashed_pct_for_delegate : (Block.t * State.t) -> Tezos_base.TzPervasives.Signature.Public_key_hash.t -> int
Sourceval update_state_denunciation : (Block.t * State.t) -> State.double_signing_state -> (State.t * bool, Tezos_base.TzPervasives.tztrace) result Lwt.t
Sourceval 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.

Sourceval 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

OCaml

Innovation. Community. Security.