Module Tezos_alpha_test_helpers.State

type operation_mode =
  1. | Batch
  2. | Wait
  3. | Bake
type t = {
  1. account_map : State_account.account_map;
  2. total_supply : Tezos_alpha_test_helpers.State_account.Tez.t;
  3. constants : Tezos_protocol_alpha.Protocol.Alpha_context.Constants.Parametric.t;
  4. param_requests : (string * Adaptive_issuance_helpers.staking_parameters * int) list;
  5. force_ai_vote_yes : bool;
  6. baking_policy : Block.baker_policy option;
  7. payload_round : int option;
  8. last_level_rewards : Tezos_protocol_alpha.Protocol.Alpha_context.Raw_level.t;
  9. snapshot_balances : (string * State_account.balance) list Tezos_base.TzPervasives.String.Map.t;
  10. saved_rate : Q.t option;
  11. burn_rewards : bool;
  12. pending_operations : Tezos_protocol_alpha.Protocol.Alpha_context.packed_operation list;
  13. pending_batch : Tezos_protocol_alpha.Protocol.Alpha_context.packed_operation list;
  14. source_batch : string option;
  15. pending_slashes : (Tezos_alpha_test_helpers.Signature.Public_key_hash.t * Tezos_protocol_alpha.Protocol.Denunciations_repr.item) list;
  16. double_signings : double_signing_state list;
  17. force_attest_all : bool;
  18. force_preattest_all : bool;
  19. check_finalized_every_block : (Block.full_metadata -> (Block.t * t) -> unit Tezos_base.TzPervasives.tzresult Lwt.t) list;
  20. check_finalized_current_block : (Block.full_metadata -> (Block.t * t) -> unit Tezos_base.TzPervasives.tzresult Lwt.t) list;
  21. previous_metadata : Block.full_metadata option;
  22. operation_mode : operation_mode;
  23. grandparent : Block.t;
}

Type of the state

val param_wait : t -> int

Expected number of cycles before staking parameters get applied

val unstake_wait : t -> int

Expected number of cycles before staking unstaked funds get unfrozen

val find_account : string -> t -> State_account.account_state

From a name, returns the corresponding account

val find_account_from_pkh : Signature.public_key_hash -> t -> string * State_account.account_state
val get_delegates_of : name:Tezos_base.TzPervasives.String.t -> t -> State_account.account_state list
val is_self_delegate : string -> t -> bool

Returns true iff account is a delegate

val apply_finalize : Tezos_base.TzPervasives.String.Map.key -> t -> t
val apply_unslashable_for_all : Tezos_alpha_test_helpers.State_account.Cycle.cycle -> t -> t
val apply_rewards : baker:string -> Block.t -> t -> t Tezos_base.TzPervasives.tzresult Lwt.t
val update_account : string -> State_account.account_state -> t -> t

Given an account name and new account state, updates state accordingly Preferably use other specific update functions

val update_account_f : string -> (State_account.account_state -> State_account.account_state) -> t -> t
val update_delegate : string -> string option -> t -> t
val apply_update_consensus_key : string -> Tezos_protocol_alpha.Protocol.Alpha_context.Cycle.cycle -> Signature.public_key_hash -> t -> t
val apply_update_companion_key : string -> Tezos_protocol_alpha.Protocol.Alpha_context.Cycle.cycle -> Signature.public_key_hash -> t -> t
val add_pending_operations : Tezos_protocol_alpha.Protocol.Alpha_context.packed_operation list -> t -> t
val add_current_block_check : (Block.full_metadata -> (Block.t * t) -> unit Tezos_base.TzPervasives.tzresult Lwt.t) -> t -> t