Module Tezos_alpha_test_helpers.Context

type t =
  1. | B of Block.t
  2. | I of Incremental.t

A delegate's keys and attesting slots at a given level.

val get_attesters : t -> attester list Tezos_base.TzPervasives.tzresult Lwt.t

Retrieves the attesting rights at the level of the given context by calling Plugin.RPC.Validators.S.validators.

Returns an attester at the level of the given context.

If manager_pkh is provided, returns the attester with this manager key (delegate) and fails if there is no such attester. If manager_pkh is omitted, returns the first element of the output of get_attesters.

val get_first_different_attesters : t -> (attester * attester) Tezos_base.TzPervasives.tzresult Lwt.t

Return the two first elements of the list returns by get_attesters.

Return the nth element of the list returns by get_attesters.

val attester_has_bls_key : attester -> bool

Whether the attester's **consensus key** is a BLS key.

val get_attesters_with_bls_key : t -> attester list Tezos_base.TzPervasives.tzresult Lwt.t

Same as get_attesters but returns only attesters with a BLS consensus key.

val get_attester_with_bls_key : t -> attester Tezos_base.TzPervasives.tzresult Lwt.t

Returns an attester with a BLS consensus key (the first eligible attester returned by get_attesters).

Counts the number of attesting slots that the given delegate has in the requested level. If ommited, level defaults to the next level.

Sums the result of get_attesting_power_for_delegate over a list of levels.

val get_total_voting_power : t -> int64 Tezos_protocol_alpha.Environment.Error_monad.shell_tzresult Lwt.t

Returns the seed of the cycle to which the block belongs to.

Returns all the constants of the protocol

The default constants used in the test framework. To be used with init_with_constants.

val get_bonus_reward : t -> attesting_power:int -> Tezos_protocol_alpha.Protocol.Alpha_context.Tez.t Tezos_base.TzPervasives.tzresult Lwt.t
val get_attesting_reward : t -> expected_attesting_power:int -> Tezos_protocol_alpha.Protocol.Alpha_context.Tez.t Tezos_base.TzPervasives.tzresult Lwt.t
val get_adaptive_issuance_launch_cycle : t -> Tezos_protocol_alpha.Protocol.Alpha_context.Cycle.t option Tezos_base.TzPervasives.tzresult Lwt.t
val get_ai_current_yearly_rate : t -> string Tezos_base.TzPervasives.tzresult Lwt.t
val get_ai_current_yearly_rate_exact : t -> Q.t Tezos_base.TzPervasives.tzresult Lwt.t
val get_consecutive_round_zero : t -> Stdlib.Int32.t Tezos_base.TzPervasives.tzresult Lwt.t
module Vote : sig ... end
module Dal : sig ... end
module Contract : sig ... end
module Delegate : sig ... end
module Sc_rollup : sig ... end
type (_, _) tup =
  1. | T1 : ('a, 'a) tup
  2. | T2 : ('a, 'a * 'a) tup
  3. | T3 : ('a, 'a * 'a * 'a) tup
  4. | TList : int -> ('a, 'a list) tup
val tup_hd : ('a, 'elts) tup -> 'elts -> 'a
type 'accounts init := ?rng_state:Stdlib.Random.State.t -> ?commitments:Tezos_protocol_alpha.Protocol.Alpha_context.Commitment.t list -> ?bootstrap_balances:int64 list -> ?bootstrap_delegations: Tezos_alpha_test_helpers.Signature.Public_key_hash.t option list -> ?bootstrap_consensus_keys: Tezos_alpha_test_helpers.Signature.Public_key.t option list -> ?consensus_committee_size:int -> ?consensus_threshold_size:int -> ?min_proposal_quorum:int32 -> ?bootstrap_contracts: Tezos_protocol_alpha.Protocol.Alpha_context.Parameters.bootstrap_contract list -> ?level:int32 -> ?cost_per_byte:Tezos_protocol_alpha.Protocol.Alpha_context.Tez.t -> ?issuance_weights: Tezos_protocol_alpha.Protocol.Alpha_context.Constants.Parametric.issuance_weights -> ?origination_size:int -> ?blocks_per_cycle:int32 -> ?cycles_per_voting_period:int32 -> ?sc_rollup_arith_pvm_enable:bool -> ?sc_rollup_private_enable:bool -> ?sc_rollup_riscv_pvm_enable:bool -> ?dal_enable:bool -> ?dal_incentives_enable:bool -> ?zk_rollup_enable:bool -> ?hard_gas_limit_per_block: Tezos_protocol_alpha.Protocol.Alpha_context.Gas.Arith.integral -> ?nonce_revelation_threshold:int32 -> ?dal:Tezos_protocol_alpha.Protocol.Alpha_context.Constants.Parametric.dal -> ?adaptive_issuance: Tezos_protocol_alpha.Protocol.Alpha_context.Constants.Parametric.adaptive_issuance -> ?allow_tz4_delegate_enable:bool -> ?aggregate_attestation:bool -> unit -> (Block.t * 'accounts) Tezos_base.TzPervasives.tzresult Lwt.t
val init_gen : (Tezos_protocol_alpha.Protocol.Alpha_context.Contract.t, 'accounts) tup -> 'accounts init

Returns an initial block and the implicit contracts corresponding to its bootstrap accounts. The number of bootstrap accounts, and the structure of the returned contracts, are specified by the tup argument.

init_n n : returns an initial block with n initialized accounts and the associated implicit contracts

init1 : returns an initial block with 1 initialized bootstrap account and the associated implicit contract

init2 : returns an initial block with 2 initialized bootstrap accounts and the associated implicit contracts

init3 : returns an initial block with 3 initialized bootstrap accounts and the associated implicit contracts

init_with_parameters_gen tup params returns an initial block parametrised with params and the implicit contracts corresponding to its bootstrap accounts. The number of bootstrap accounts, and the structure of the returned contracts, are specified by the tup argument.

init_with_parameters_n params n returns an initial block parametrized with params with n initialized accounts and the associated implicit contracts

init_with_parameters1 params returns an initial block parametrized with params with one initialized account and the associated implicit contract.

init_with_parameters2 params returns an initial block parametrized with params with two initialized accounts and the associated implicit contracts

default_raw_context returns a Raw_context.t for use in tests below Alpha_context

raw_context_from_constants returns a Raw_context.t for use in tests below Alpha_context