package tezt-tezos

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

Module Tezt_tezos.TezSource

Helpers for dealing with units of tez.

Please note that none of the functions here perform any bounds checks.

Sourcetype t

A unit of tez

Sourceval of_int : int -> t

Make t from the whole number of tez. This doesn't perform any bounds checks.

Sourceval of_mutez_int : int -> t

Make t from the whole number of micro tez. This doesn't perform any bounds checks.

Sourceval of_mutez_int64 : int64 -> t

Make t from the whole number of micro tez. This doesn't perform any bounds checks.

Sourceval zero : t

0 tez

Sourceval one : t

1 tez

Sourceval to_string : t -> string

Convert t to a string.

Sourceval mutez_int64 : t -> int64

Convert t to a mutez integer.

Sourceval to_float : t -> float

Convert t to a float of tez.

Sourceval to_mutez : t -> int

Convert t to an int.

Sourceval (+) : t -> t -> t

Addition. This doesn't perform any bounds checks.

Sourceval (-) : t -> t -> t

Subtraction. This doesn't perform any bound checks.

Sourceval (/!) : t -> int64 -> t

Division. This doesn't perform any bound checks.

Sourceval parse_floating : string -> t

Parsing. Parse a floating point number of tez.

Any string of digits followed by an optional point and another string of digits should parse successfully, provided that the expressed number is within bounds allowed for tez (up to 6 decimal places). For example: "123.4356" will parse, while "1.24723953794217492" won't, because it's too precise.

Sourceval typ : t Tezt.Check.typ

The tez Check.typ

OCaml

Innovation. Community. Security.