package octez-protocol-alpha-libs
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=ddfb5076eeb0b32ac21c1eed44e8fc86a6743ef18ab23fff02d36e365bb73d61
sha512=d22a827df5146e0aa274df48bc2150b098177ff7e5eab52c6109e867eb0a1f0ec63e6bfbb0e3645a6c2112de3877c91a17df32ccbff301891ce4ba630c997a65
doc/octez-protocol-alpha-libs.test-helpers/Tezos_alpha_test_helpers/Account_helpers/index.html
Module Tezos_alpha_test_helpers.Account_helpersSource
Account_helpers defines a type abstracting the information of an account in the protocol. This includes its pkh, delegate, any funds, staking parameters, etc...
A type balance is also defined, as an observed state of funds for a given account, i.e balance information that one might get from calling RPCs.
type account_state = {pkh : Tezos_base.TzPervasives.Signature.Public_key_hash.t;contract : Tezos_protocol_alpha.Protocol.Alpha_context.Contract.t;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 cyclec + 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_active_cycle : Tezos_alpha_test_helpers.Tez_staking_helpers.Cycle.t;
}Abstract information of accounts
val init_account :
?delegate:string ->
pkh:Tezos_base.TzPervasives.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 ->
?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_active_cycle:Tezos_alpha_test_helpers.Tez_staking_helpers.Cycle.cycle ->
unit ->
account_statetype 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 assert_balance_equal :
loc:string ->
string ->
balance ->
balance ->
(unit, Tezos_base.TzPervasives.tztrace) 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)
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) result Lwt.tval 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.t