package octez-protocol-alpha-libs

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Tezos_alpha_test_helpers.State_accountSource

State_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 end

Representation of Tez with non integer values

Frozen_tez represents frozen stake and frozen unstaked funds. Properties:

Representation of Unstaked frozen deposits

Representation of unstaked finalizable tez

Sourceval tez_to_pseudo : round:[ `Down | `Up ] -> Tez.t -> Z.t -> Frozen_tez.t -> Z.t

Pseudotoken helpers

Sourceval pseudo_to_partial_tez : Z.t -> Z.t -> Frozen_tez.t -> Q.t
Sourceval stake_values_real : Tez.t -> Z.t -> Frozen_tez.t -> Z.t * Q.t
Sourceval unstake_values_real : Tez.t -> Z.t -> Frozen_tez.t -> Z.t * Q.t
include module type of struct include Account_helpers end
Sourceval fail_account_not_found : string -> string -> 'a
Sourcetype account_state = Account_helpers.account_state = {
  1. pkh : Tezos_base.TzPervasives.Signature.Public_key_hash.t;
  2. contract : Tezos_protocol_alpha.Protocol.Alpha_context.Contract.t;
  3. delegate : string option;
  4. parameters : Adaptive_issuance_helpers.staking_parameters;
  5. liquid : Tez_staking_helpers.Tez.t;
  6. bonds : Tez_staking_helpers.Tez.t;
  7. frozen_deposits : Tez_staking_helpers.Frozen_tez.t;
  8. unstaked_frozen : Tez_staking_helpers.Unstaked_frozen.t;
  9. unstaked_finalizable : Tez_staking_helpers.Unstaked_finalizable.t;
  10. staking_delegator_numerator : Z.t;
  11. staking_delegate_denominator : Z.t;
  12. 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.

    *)
  13. slashed_cycles : Tezos_alpha_test_helpers.Tez_staking_helpers.Cycle.t list;
  14. last_active_cycle : Tezos_alpha_test_helpers.Tez_staking_helpers.Cycle.t;
}

Abstract information of accounts

Sourceval 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_state
Sourcetype balance = Account_helpers.balance = {
  1. liquid_b : Tez_staking_helpers.Tez.t;
  2. bonds_b : Tez_staking_helpers.Tez.t;
  3. staked_b : Tez_staking_helpers.Partial_tez.t;
  4. unstaked_frozen_b : Tez_staking_helpers.Tez.t;
  5. unstaked_finalizable_b : Tez_staking_helpers.Tez.t;
  6. staking_delegator_numerator_b : Z.t;
  7. staking_delegate_denominator_b : Z.t;
}

Balance returned by RPCs. Partial tez are rounded down

Sourceval balance_zero : balance
Sourceval balance_pp : Format.formatter -> balance -> unit
Sourceval balance_update_pp : Format.formatter -> (balance * balance) -> unit
Sourceval assert_balance_equal : loc:string -> string -> balance -> balance -> (unit, Tezos_base.TzPervasives.tztrace) result Lwt.t
Sourceval assert_pseudotokens_consistency : loc:string -> balance -> account_state -> string -> account_state Tezos_base.TzPervasives.String.Map.t -> unit Tezos_base.TzPervasives.tzresult Lwt.t
Sourceval 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.t
Sourceval 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.t
Sourceval log_debug_rpc_balance : string -> Tezos_protocol_alpha.Protocol.Alpha_context.Contract.t -> Block.t -> unit Tezos_base.TzPervasives.tzresult Lwt.t
Sourceval log_debug_balance_update : Tezos_base.TzPervasives.String.Map.key -> account_map -> account_map -> unit
Sourceval current_total_frozen_deposits_with_limits : account_state -> Tezos_protocol_alpha.Protocol.Alpha_context.Tez.t
Sourceval stake_from_unstake : Tezos_protocol_alpha.Protocol.Alpha_context.Tez.t -> Cycle.cycle -> int -> Tezos_base.TzPervasives.String.Map.key -> account_state Tezos_base.TzPervasives.String.Map.t -> account_state Tezos_base.TzPervasives.String.Map.t * Tezos_protocol_alpha.Protocol.Alpha_context.Tez.t
Sourceval apply_stake : Tezos_protocol_alpha.Protocol.Alpha_context.Tez.t -> Cycle.cycle -> int -> Tezos_base.TzPervasives.String.Map.key -> account_state Tezos_base.TzPervasives.String.Map.t -> account_state Tezos_base.TzPervasives.String.Map.t
Sourceval apply_unstake : Tezos_alpha_test_helpers__Tez_staking_helpers.Cycle.t -> Tezos_protocol_alpha.Protocol.Alpha_context.Tez.t -> Tezos_base.TzPervasives.String.Map.key -> account_state Tezos_base.TzPervasives.String.Map.t -> account_state Tezos_base.TzPervasives.String.Map.t
Sourceval apply_unslashable_f : Tezos_alpha_test_helpers__Tez_staking_helpers.Cycle.t -> account_state -> account_state
Sourceval apply_unslashable_for_all : Tezos_alpha_test_helpers__Tez_staking_helpers.Cycle.t -> account_state Tezos_base.TzPervasives.String.Map.t -> account_state Tezos_base.TzPervasives.String.Map.t

Compute the staking rights for current_cycle + consensus_rights_delay + 1 and save them into account.frozen_rights for each delegate.

OCaml

Innovation. Community. Security.