Mavryk_001_PtAtLas_test_helpers.Adaptive_issuance_helpers
module Tez : sig ... end
Tez manipulation module
module Partial_tez : sig ... end
Representation of Tez with non integer values
module Cycle = Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Cycle
module Frozen_tez : sig ... end
Frozen_tez
represents frozen stake and frozen unstaked funds. Properties:
module Unstaked_frozen : sig ... end
Representation of Unstaked frozen deposits
module Unstaked_finalizable : sig ... end
Representation of unstaked finalizable mav
Abstraction of the staking parameters for tests
module CycleMap : sig ... end
type account_state = {
pkh : Mavryk_base.TzPervasives.Signature.Public_key_hash.t;
contract : Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Contract.t;
delegate : string option;
parameters : staking_parameters;
liquid : Tez.t;
bonds : Tez.t;
frozen_deposits : Frozen_tez.t;
unstaked_frozen : Unstaked_frozen.t;
unstaked_finalizable : Unstaked_finalizable.t;
staking_delegator_numerator : Z.t;
staking_delegate_denominator : Z.t;
frozen_rights : Tez.t CycleMap.t;
slashed_cycles : Cycle.t list;
}
Abstract information of accounts
val init_account :
?delegate:string ->
pkh:Mavryk_base.TzPervasives.Signature.Public_key_hash.t ->
contract:Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Contract.t ->
parameters:staking_parameters ->
?liquid:Tez.mav ->
?bonds:Tez.mav ->
?frozen_deposits:Frozen_tez.t ->
?unstaked_frozen:Unstaked_frozen.t ->
?unstaked_finalizable:Unstaked_finalizable.t ->
?staking_delegator_numerator:Z.t ->
?staking_delegate_denominator:Z.t ->
?frozen_rights:Tez.t CycleMap.t ->
?slashed_cycles:Cycle.t list ->
unit ->
account_state
type account_map = account_state Mavryk_base.TzPervasives.String.Map.t
type balance = {
liquid_b : Tez.t;
bonds_b : Tez.t;
staked_b : Partial_tez.t;
unstaked_frozen_b : Partial_tez.t;
unstaked_finalizable_b : Tez.t;
staking_delegator_numerator_b : Z.t;
staking_delegate_denominator_b : Z.t;
}
Balance returned by RPCs. Partial mav are rounded down
val balance_zero : balance
val balance_of_account :
Mavryk_base.TzPervasives.String.Map.key ->
account_map ->
balance
val balance_pp : Stdlib.Format.formatter -> balance -> unit
val assert_balance_equal :
loc:string ->
string ->
balance ->
balance ->
(unit, Mavryk_base.TzPervasives.tztrace) Stdlib.result Lwt.t
val update_account :
f:('a -> 'b) ->
Mavryk_base.TzPervasives.String.Map.key ->
'c Mavryk_base.TzPervasives.String.Map.t ->
'c Mavryk_base.TzPervasives.String.Map.t
val add_liquid_rewards :
Tez.mav ->
Mavryk_base.TzPervasives.String.Map.key ->
account_state Mavryk_base.TzPervasives.String.Map.t ->
account_state Mavryk_base.TzPervasives.String.Map.t
val add_frozen_rewards :
Tez.mav ->
Mavryk_base.TzPervasives.String.Map.key ->
account_state Mavryk_base.TzPervasives.String.Map.t ->
account_state Mavryk_base.TzPervasives.String.Map.t
val stake_from_unstake :
Tez.t ->
Cycle.cycle ->
int ->
Mavryk_base.TzPervasives.String.Map.key ->
account_state Mavryk_base.TzPervasives.String.Map.t ->
account_state Mavryk_base.TzPervasives.String.Map.t * Tez.t
val apply_stake :
Tez.t ->
Cycle.cycle ->
int ->
Mavryk_base.TzPervasives.String.Map.key ->
account_state Mavryk_base.TzPervasives.String.Map.t ->
account_state Mavryk_base.TzPervasives.String.Map.t
val apply_unstake :
Cycle.t ->
Tez.t ->
Mavryk_base.TzPervasives.String.Map.key ->
account_state Mavryk_base.TzPervasives.String.Map.t ->
account_state Mavryk_base.TzPervasives.String.Map.t
val apply_unslashable_f : Cycle.t -> account_state -> account_state
val apply_unslashable :
Cycle.t ->
Mavryk_base.TzPervasives.String.Map.key ->
account_state Mavryk_base.TzPervasives.String.Map.t ->
account_state Mavryk_base.TzPervasives.String.Map.t
val apply_unslashable_for_all :
Cycle.t ->
account_state Mavryk_base.TzPervasives.String.Map.t ->
account_state Mavryk_base.TzPervasives.String.Map.t
val balance_and_total_balance_of_account :
Mavryk_base.TzPervasives.String.Map.key ->
account_map ->
balance * Tez.t
val apply_slashing :
(Mavryk_base.TzPervasives.Signature.Public_key_hash.t
* Mavryk_protocol_001_PtAtLas.Protocol.Denunciations_repr.item) ->
Cycle.cycle ->
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Constants.Parametric.t ->
account_state Mavryk_base.TzPervasives.String.Map.t ->
account_state Mavryk_base.TzPervasives.String.Map.t * Tez.t
val update_frozen_rights_cycle :
CycleMap.key ->
account_state Mavryk_base.TzPervasives.String.Map.t ->
account_state Mavryk_base.TzPervasives.String.Map.t
val get_balance_from_context :
Mavryk_001_PtAtLas_test_helpers__Context.t ->
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Contract.t ->
(balance * Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Tez.t,
Mavryk_base.TzPervasives.tztrace)
Stdlib.result
Lwt.t
val assert_balance_check :
loc:string ->
Mavryk_001_PtAtLas_test_helpers__Context.t ->
Mavryk_base.TzPervasives.String.Map.key ->
account_state Mavryk_base.TzPervasives.String.Map.t ->
(unit, Mavryk_base.TzPervasives.tztrace) Stdlib.result Lwt.t
val get_launch_cycle :
loc:string ->
Block.t ->
(Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Cycle.t,
Mavryk_base.TzPervasives.tztrace)
Stdlib.result
Lwt.t
AI operations
val set_delegate_parameters :
Context.t ->
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Contract.t ->
parameters:staking_parameters ->
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Operation.packed
Mavryk_base.TzPervasives.tzresult
Lwt.t
val finalize_unstake :
Context.t ->
?amount:Tez.mav ->
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Contract.t ->
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Operation.packed
Mavryk_base.TzPervasives.tzresult
Lwt.t
val portion_of_rewards_to_liquid_for_cycle :
?policy:Block.baker_policy ->
Mavryk_001_PtAtLas_test_helpers__Context.t ->
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Cycle.t ->
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.public_key_hash ->
Tez.mav ->
(Tez.t, Mavryk_base.TzPervasives.tztrace) Stdlib.result Lwt.t