package tezos-protocol-alpha

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

See the definitions inside the module.

type Tezos_protocol_environment_alpha.Error_monad.error +=
  1. | Expression_already_registered
type Tezos_protocol_environment_alpha.Error_monad.error +=
  1. | Badly_formed_constant_expression

A constant is the prim of the literal characters "constant". A constant must have a single argument, being a string with a well formed hash of a Micheline expression (i.e generated by Script_expr_hash.to_b58check).

get context hash retrieves the Micheline value with the given hash.

Fails with Nonexistent_global if no value is found at the given hash.

Fails with Storage_error Corrupted_data if the deserialisation fails.

Consumes Gas_repr.read_bytes_cost <size of the value>.

register context value Register a constant in the global table of constants, returning the hash and storage bytes consumed.

Does not type-check the Micheline code being registered, allow potentially ill-typed Michelson values (see note at top of module in global_constants_storage.mli).

The constant is stored unexpanded, but it is temporarily expanded at registration time only to check the expanded version respects the following limits.

Fails with Expression_too_deep if, after fully, expanding all constants, the expression would contain too many nested levels, that is more than Constants_repr.max_allowed_global_constant_depth.

Fails with Badly_formed_constant_expression if constants are not well-formed (see declaration of Badly_formed_constant_expression) or with Nonexistent_global if a referenced constant does not exist in the table.

Consumes serialization cost. Consumes Gas_repr.write_bytes_cost <size> where size is the number of bytes in the binary serialization provided by Script.expr_encoding.

expand context expr Replaces every constant in the given Michelson expression with its value stored in the global table.

The expansion is applied recursively so that the returned expression contains no constant.

Fails with Badly_formed_constant_expression if constants are not well-formed (see declaration of Badly_formed_constant_expression) or with Nonexistent_global if a referenced constant does not exist in the table.

module Internal_for_tests : sig ... end

This module discloses definitions that are only useful for tests and must not be used otherwise.

OCaml

Innovation. Community. Security.