package tezos-protocol-alpha
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=43723d096307603703a1a89ed1b2eb202b365f5e7824b96b0cbf813b343a6cf7
sha512=b2a637f2e965000d3d49ad85277ca24d6cb07a1a7cf2bc69d296d8b03ad78c3eaa8e21e94b9162e62c2e11649cd03bc845b2a3dafe623b91065df69d47dc8e4f
doc/tezos-protocol-alpha.raw/Tezos_raw_protocol_alpha/Script_repr/index.html
Module Tezos_raw_protocol_alpha.Script_repr
Source
Defines a Michelson expression representation as a Micheline node with canonical (int
) location and Michelson_v1_primitives.prim
as content.
Types expr
and node
both define representation of Michelson expressions and are indeed the same type internally, although this is not visible outside Micheline due to interface abstraction.
Locations are used by Micheline mostly for error-reporting and pretty- printing expressions. canonical_location
is simply an int
.
Annotations attached to Michelson expressions.
Represents a Michelson expression as canonical Micheline.
A record containing either an underlying serialized representation of an expression or a deserialized one, or both. If either is absent, it will be computed on-demand.
type 'location michelson_node =
('location, Michelson_v1_primitives.prim)
Tezos_protocol_environment_alpha.Micheline.node
Same as expr
, but used in different contexts, as required by Micheline's abstract interface.
Type t
joins the contract's code and storage in a single record.
Returns (a lower bound on) the cost to deserialize a lazy_expr
. If the expression has already been deserialized (i.e. the lazy expression contains the deserialized value or both the bytes representation and the deserialized value) then the cost is free.
Like force_decode_cost
, excepted that the returned cost does not depend on the internal state of the lazy_expr. This means that the cost is never free (excepted for zero bytes expressions).
Returns the cost to serialize a lazy_expr
. If the expression has already been deserialized (i.e. le lazy expression contains the bytes representation or both the bytes representation and the deserialized value) then the cost is free.
Computes the cost of serializing a given term.
micheline_nodes root
returns the number of internal nodes in the micheline expression held from root
.
val fold :
('loc, 'prim) Tezos_protocol_environment_alpha.Micheline.node ->
'acc ->
('acc ->
('loc, 'prim) Tezos_protocol_environment_alpha.Micheline.node ->
'acc) ->
'acc
fold node i f
traverses node
applying f
on an accumulator initialized by i
.