package octez-protocol-alpha-libs

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
val join_errors : (unit, 'a list) Stdlib.result -> (unit, 'a list) Stdlib.result -> (unit, 'a list) Stdlib.result Lwt.t
module Tez : sig ... end

Tez manipulation module

module Partial_tez : sig ... end

Representation of Tez with non integer values

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 tez

type staking_parameters = {
  1. limit_of_staking_over_baking : Q.t;
  2. edge_of_baking_over_staking : Q.t;
}

Abstraction of the staking parameters for tests

module CycleMap : sig ... end
type 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 : staking_parameters;
  5. liquid : Tez.t;
  6. bonds : Tez.t;
  7. frozen_deposits : Frozen_tez.t;
  8. unstaked_frozen : Unstaked_frozen.t;
  9. unstaked_finalizable : Unstaked_finalizable.t;
  10. staking_delegator_numerator : Z.t;
  11. staking_delegate_denominator : Z.t;
  12. frozen_rights : Tez.t CycleMap.t;
  13. slashed_cycles : Cycle.t list;
}

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: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 -> unit -> account_state
type balance = {
  1. liquid_b : Tez.t;
  2. bonds_b : Tez.t;
  3. staked_b : Partial_tez.t;
  4. unstaked_frozen_b : Tez.t;
  5. unstaked_finalizable_b : 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

val balance_zero : balance
val balance_pp : Stdlib.Format.formatter -> balance -> unit
val balance_update_pp : Stdlib.Format.formatter -> (balance * balance) -> unit
val assert_balance_equal : loc:string -> string -> balance -> balance -> (unit, Tezos_base.TzPervasives.tztrace) Stdlib.result Lwt.t
val apply_unslashable_f : Cycle.t -> account_state -> account_state
val balance_and_total_balance_of_account : Tezos_base.TzPervasives.String.Map.key -> account_map -> balance * Tez.t
val 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.t

AI operations

val portion_of_rewards_to_liquid_for_cycle : ?policy:Block.baker_policy -> Tezos_alpha_test_helpers__Context.t -> Tezos_protocol_alpha.Protocol.Alpha_context.Cycle.t -> Tezos_protocol_alpha.Protocol.Alpha_context.public_key_hash -> Tez.t -> (Tez.t, Tezos_base.TzPervasives.tztrace) Stdlib.result Lwt.t
OCaml

Innovation. Community. Security.