Tezos_alpha_test_helpers.State_accountState_account is dedicated to operations in State.t that would modify an account_state. This includes any operation like transfer, stake, unstake, set_delegate_parameters, anything related to slashing or rewards, etc...
include module type of struct include Tez_staking_helpers endmodule Cycle = Tezos_alpha_test_helpers.Tez_staking_helpers.Cyclemodule Percentage = Tezos_alpha_test_helpers.Tez_staking_helpers.Percentagemodule Tez = Tez_staking_helpers.Tezmodule Partial_tez = Tez_staking_helpers.Partial_tezRepresentation of Tez with non integer values
module Frozen_tez = Tez_staking_helpers.Frozen_tezFrozen_tez represents frozen stake and frozen unstaked funds. Properties:
module Unstaked_frozen = Tez_staking_helpers.Unstaked_frozenRepresentation of Unstaked frozen deposits
module Unstaked_finalizable = Tez_staking_helpers.Unstaked_finalizableRepresentation of unstaked finalizable tez
val tez_to_pseudo :
round:[ `Down | `Up ] ->
Tez.t ->
Z.t ->
Frozen_tez.t ->
Z.tPseudotoken helpers
val pseudo_to_partial_tez : Z.t -> Z.t -> Frozen_tez.t -> Q.tval stake_values_real : Tez.t -> Z.t -> Frozen_tez.t -> Z.t * Q.tval unstake_values_real : Tez.t -> Z.t -> Frozen_tez.t -> Z.t * Q.tinclude module type of struct include Account_helpers endmodule CycleMap = Account_helpers.CycleMaptype account_state = Account_helpers.account_state = {pkh : Tezos_alpha_test_helpers.Signature.Public_key_hash.t;contract : Tezos_protocol_alpha.Protocol.Alpha_context.Contract.t;revealed : bool;delegate : string option;parameters : Adaptive_issuance_helpers.staking_parameters;liquid : Tez_staking_helpers.Tez.t;bonds : Tez_staking_helpers.Tez.t;frozen_deposits : Tez_staking_helpers.Frozen_tez.t;unstaked_frozen : Tez_staking_helpers.Unstaked_frozen.t;unstaked_finalizable : Tez_staking_helpers.Unstaked_finalizable.t;staking_delegator_numerator : Z.t;staking_delegate_denominator : Z.t;frozen_rights : Tez_staking_helpers.Tez.t CycleMap.t;The portion of rights that comes from staking, used for baking/attesting during the specified cycle.
At the end of cycle c, the current frozen deposits of the delegate (own + co-staked, taking limit_of_staking_over_baking into account) are added to this table for cycle c + consensus_rights_delay + 1. The table is unmodified if at that time, the account is not a delegate or is a deactivated delegate.
slashed_cycles : Tezos_alpha_test_helpers.Tez_staking_helpers.Cycle.t list;last_seen_activity : Tezos_alpha_test_helpers.Tez_staking_helpers.Cycle.t
option;consensus_keys : Signature.public_key_hash CycleMap.t;companion_keys : Tezos_alpha_test_helpers.Signature.Bls.Public_key_hash.t
CycleMap.t;}Abstract information of accounts
val init_account :
name:Tezos_base.TzPervasives.String.Map.key ->
?delegate:string ->
pkh:Tezos_alpha_test_helpers.Signature.Public_key_hash.t ->
contract:Tezos_protocol_alpha.Protocol.Alpha_context.Contract.t ->
parameters:Adaptive_issuance_helpers.staking_parameters ->
?liquid:Tez_staking_helpers.Tez.t ->
?bonds:Tez_staking_helpers.Tez.t ->
?frozen_deposits:Tez_staking_helpers.Frozen_tez.t ->
?revealed:bool ->
?unstaked_frozen:Tez_staking_helpers.Unstaked_frozen.t ->
?unstaked_finalizable:Tez_staking_helpers.Unstaked_finalizable.t ->
?staking_delegator_numerator:Z.t ->
?staking_delegate_denominator:Z.t ->
?frozen_rights:Tez_staking_helpers.Tez.t CycleMap.t ->
?slashed_cycles:Tezos_alpha_test_helpers.Tez_staking_helpers.Cycle.t list ->
?last_seen_activity:Tezos_alpha_test_helpers.Tez_staking_helpers.Cycle.t ->
unit ->
account_statetype account_map = account_state Tezos_base.TzPervasives.String.Map.ttype balance = Account_helpers.balance = {liquid_b : Tez_staking_helpers.Tez.t;bonds_b : Tez_staking_helpers.Tez.t;staked_b : Tez_staking_helpers.Partial_tez.t;unstaked_frozen_b : Tez_staking_helpers.Tez.t;unstaked_finalizable_b : Tez_staking_helpers.Tez.t;staking_delegator_numerator_b : Z.t;staking_delegate_denominator_b : Z.t;}Balance returned by RPCs. Partial tez are rounded down
val balance_zero : balanceval balance_of_account :
Tezos_base.TzPervasives.String.Map.key ->
account_map ->
balanceval balance_pp : Stdlib.Format.formatter -> balance -> unitval assert_balance_equal :
loc:string ->
string ->
balance ->
balance ->
(unit, Tezos_base.TzPervasives.tztrace) Stdlib.result Lwt.tval update_account :
f:('a -> 'a) ->
Tezos_base.TzPervasives.String.Map.key ->
'a Tezos_base.TzPervasives.String.Map.t ->
'a Tezos_base.TzPervasives.String.Map.tval balance_and_total_balance_of_account :
Tezos_base.TzPervasives.String.Map.key ->
account_map ->
balance * Tez_staking_helpers.Tez.tval assert_pseudotokens_consistency :
loc:string ->
balance ->
account_state ->
string ->
account_state Tezos_base.TzPervasives.String.Map.t ->
unit Tezos_base.TzPervasives.tzresult Lwt.tval get_balance_from_context :
Tezos_alpha_test_helpers__Context.t ->
Tezos_protocol_alpha.Protocol.Alpha_context.Contract.t ->
(balance * Tezos_protocol_alpha.Protocol.Alpha_context.Tez.t,
Tezos_base.TzPervasives.tztrace)
Stdlib.result
Lwt.tval assert_balance_check :
loc:string ->
Tezos_alpha_test_helpers__Context.t ->
Tezos_base.TzPervasives.String.Map.key ->
account_state Tezos_base.TzPervasives.String.Map.t ->
(unit, Tezos_base.TzPervasives.tztrace) Stdlib.result Lwt.tval log_debug_balance :
Tezos_base.TzPervasives.String.Map.key ->
account_map ->
unitval log_debug_rpc_balance :
string ->
Tezos_protocol_alpha.Protocol.Alpha_context.Contract.t ->
Block.t ->
unit Tezos_base.TzPervasives.tzresult Lwt.tval log_debug_balance_update :
Tezos_base.TzPervasives.String.Map.key ->
account_map ->
account_map ->
unitval current_total_frozen_deposits_with_limits :
account_state ->
Tezos_protocol_alpha.Protocol.Alpha_context.Tez.tval assert_balance_evolution :
loc:string ->
for_accounts:Tezos_base.TzPervasives.String.t list ->
part:[< `liquid | `staked | `unstaked_finalizable | `unstaked_frozen ] ->
name:Tezos_base.TzPervasives.String.t ->
old_balance:balance ->
new_balance:balance ->
(Tez_staking_helpers.Partial_tez.t ->
Tez_staking_helpers.Partial_tez.t ->
bool) ->
unit Tezos_base.TzPervasives.tzresult Lwt.tval current_consensus_key :
account_state ->
Tezos_alpha_test_helpers.Tez_staking_helpers.Cycle.t ->
Tezos_alpha_test_helpers.Signature.Public_key_hash.tval current_companion_key :
account_state ->
Tezos_alpha_test_helpers.Tez_staking_helpers.Cycle.t ->
Tezos_alpha_test_helpers.Signature.Bls.Public_key_hash.t optionval latest_consensus_key :
account_state ->
Tezos_alpha_test_helpers.Tez_staking_helpers.Cycle.cycle
* Tezos_alpha_test_helpers.Signature.Public_key_hash.tval latest_companion_key :
account_state ->
Tezos_alpha_test_helpers.Tez_staking_helpers.Cycle.cycle
* Tezos_alpha_test_helpers.Signature.Bls.Public_key_hash.t optionval pp_ck_map :
(Stdlib.Format.formatter -> 'a -> unit) ->
Stdlib.Format.formatter ->
'a CycleMap.t ->
unitval assert_CKs :
loc:string ->
Tezos_alpha_test_helpers__Context.t ->
Tezos_alpha_test_helpers.Tez_staking_helpers.Cycle.t ->
Tezos_base.TzPervasives.String.Map.key ->
account_state Tezos_base.TzPervasives.String.Map.t ->
(unit, Tezos_base.TzPervasives.tztrace) Stdlib.result Lwt.tval add_liquid_rewards :
Tez.t ->
Tezos_base.TzPervasives.String.Map.key ->
account_state Tezos_base.TzPervasives.String.Map.t ->
account_state Tezos_base.TzPervasives.String.Map.tval apply_unslashable_f :
Tezos_protocol_alpha.Protocol.Alpha_context.Cycle.t ->
account_state ->
account_stateval apply_unslashable_for_all :
Tezos_protocol_alpha.Protocol.Alpha_context.Cycle.t ->
account_state Tezos_base.TzPervasives.String.Map.t ->
account_state Tezos_base.TzPervasives.String.Map.tval compute_future_frozen_rights :
Block.block ->
account_state Tezos_base.TzPervasives.String.Map.t ->
(account_state Tezos_base.TzPervasives.String.Map.t,
Tezos_base.TzPervasives.tztrace)
Stdlib.result
Lwt.tCompute the staking rights for current_cycle + consensus_rights_delay + 1 and save them into account.frozen_rights for each delegate.