package tezos-protocol-013-PtJakart
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=43723d096307603703a1a89ed1b2eb202b365f5e7824b96b0cbf813b343a6cf7
sha512=b2a637f2e965000d3d49ad85277ca24d6cb07a1a7cf2bc69d296d8b03ad78c3eaa8e21e94b9162e62c2e11649cd03bc845b2a3dafe623b91065df69d47dc8e4f
doc/tezos-protocol-013-PtJakart.raw/Tezos_raw_protocol_013_PtJakart/Script_ir_translator/index.html
Module Tezos_raw_protocol_013_PtJakart.Script_ir_translatorSource
Michelson Existential Witness types
type ex_comparable_ty = | Ex_comparable_ty : 'a Script_typed_ir.comparable_ty -> ex_comparable_ty
type ex_parameter_ty_and_entrypoints = | Ex_parameter_ty_and_entrypoints : {arg_type : ('a, _) Script_typed_ir.ty;entrypoints : 'a Script_typed_ir.entrypoints;
} -> ex_parameter_ty_and_entrypoints
type toplevel = {code_field : Alpha_context.Script.node;arg_type : Alpha_context.Script.node;storage_type : Alpha_context.Script.node;views : Script_typed_ir.view_map;
}type ('arg, 'storage) code = | Code : {code : (('arg, 'storage) Script_typed_ir.pair, (Script_typed_ir.operation Script_typed_ir.boxed_list, 'storage) Script_typed_ir.pair) Script_typed_ir.lambda;arg_type : ('arg, _) Script_typed_ir.ty;storage_type : ('storage, _) Script_typed_ir.ty;views : Script_typed_ir.view_map;entrypoints : 'arg Script_typed_ir.entrypoints;code_size : Cache_memory_helpers.sint;(*This is an over-approximation of the value size in memory, in bytes, of the contract's static part, that is its source code. This includes the code of the contract as well as the code of the views. The storage size is not taken into account by this field as it has a dynamic size.
*)
} -> ('arg, 'storage) code
type 'storage typed_view = | Typed_view : {input_ty : ('input, _) Script_typed_ir.ty;output_ty : ('output, _) Script_typed_ir.ty;kinstr : ('input * 'storage, Script_typed_ir.end_of_stack, 'output, Script_typed_ir.end_of_stack) Script_typed_ir.kinstr;original_code_expr : Alpha_context.Script.node;
} -> 'storage typed_view
type 'storage typed_view_map =
(Alpha_context.Script_string.t, 'storage typed_view) Script_typed_ir.maptype ('a, 's, 'b, 'u) cinstr = {apply : 'r 'f. ('a, 's) Script_typed_ir.kinfo -> ('b, 'u, 'r, 'f) Script_typed_ir.kinstr -> ('a, 's, 'r, 'f) Script_typed_ir.kinstr;
}type ('a, 's, 'b, 'u) descr = {loc : Alpha_context.Script.location;bef : ('a, 's) Script_typed_ir.stack_ty;aft : ('b, 'u) Script_typed_ir.stack_ty;instr : ('a, 's, 'b, 'u) cinstr;
}Flag that drives unparsing of typed values to nodes.
Optimized_legacymust be kept backward-compatible in order to compute valid hashes (of big map keys).Optimizedmay be used as long as the result can be read by parse_data.Readableproduces withstringvalues instead ofbyteswhen feasible.
type type_logger =
Alpha_context.Script.location ->
stack_ty_before:Alpha_context.Script.expr list ->
stack_ty_after:Alpha_context.Script.expr list ->
unitHigh-level Michelson Data Types
val empty_big_map :
'a Script_typed_ir.comparable_ty ->
('b, _) Script_typed_ir.ty ->
('a, 'b) Script_typed_ir.big_mapCreate an empty big_map
val big_map_mem :
Alpha_context.context ->
'key ->
('key, 'value) Script_typed_ir.big_map ->
(bool * Alpha_context.context)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tval big_map_get :
Alpha_context.context ->
'key ->
('key, 'value) Script_typed_ir.big_map ->
('value option * Alpha_context.context)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tval big_map_update :
Alpha_context.context ->
'key ->
'value option ->
('key, 'value) Script_typed_ir.big_map ->
(('key, 'value) Script_typed_ir.big_map * Alpha_context.context)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tUpdate a big map. See big_map_get_and_update for details.
val big_map_get_and_update :
Alpha_context.context ->
'key ->
'value option ->
('key, 'value) Script_typed_ir.big_map ->
(('value option * ('key, 'value) Script_typed_ir.big_map)
* Alpha_context.context)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tUpdate a big map, returning the old value of the given key and the new map.
This does not modify the underlying storage, only the diff table.
val ty_eq :
error_details:'error_trace Script_tc_errors.error_details ->
Alpha_context.Script.location ->
('a, 'ac) Script_typed_ir.ty ->
('b, 'bc) Script_typed_ir.ty ->
((('a, 'ac) Script_typed_ir.ty, ('b, 'bc) Script_typed_ir.ty) eq,
'error_trace)
Gas_monad.tval parse_comparable_data :
?type_logger:type_logger ->
Alpha_context.context ->
'a Script_typed_ir.comparable_ty ->
Alpha_context.Script.node ->
('a * Alpha_context.context)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tParsing and Typechecking Michelson
val parse_data :
?type_logger:type_logger ->
Alpha_context.context ->
legacy:bool ->
allow_forged:bool ->
('a, _) Script_typed_ir.ty ->
Alpha_context.Script.node ->
('a * Alpha_context.context)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tval unparse_comparable_data :
loc:'loc ->
Alpha_context.context ->
unparsing_mode ->
'a Script_typed_ir.comparable_ty ->
'a ->
('loc Alpha_context.Script.michelson_node * Alpha_context.context)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tval parse_instr :
?type_logger:type_logger ->
tc_context ->
Alpha_context.context ->
legacy:bool ->
Alpha_context.Script.node ->
('a, 's) Script_typed_ir.stack_ty ->
(('a, 's) judgement * Alpha_context.context)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tval parse_big_map_value_ty :
Alpha_context.context ->
legacy:bool ->
Alpha_context.Script.node ->
(ex_ty * Alpha_context.context)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresultparse_ty specialized for the right-hand side part of a big map type, i.e. the `value` in `big_map key value`.
val parse_packable_ty :
Alpha_context.context ->
legacy:bool ->
Alpha_context.Script.node ->
(ex_ty * Alpha_context.context)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresultval parse_passable_ty :
Alpha_context.context ->
legacy:bool ->
Alpha_context.Script.node ->
(ex_ty * Alpha_context.context)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresultval parse_comparable_ty :
Alpha_context.context ->
Alpha_context.Script.node ->
(ex_comparable_ty * Alpha_context.context)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresultval parse_parameter_ty_and_entrypoints :
Alpha_context.context ->
legacy:bool ->
Alpha_context.Script.node ->
(ex_parameter_ty_and_entrypoints * Alpha_context.context)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresultval parse_view_input_ty :
Alpha_context.context ->
stack_depth:int ->
legacy:bool ->
Alpha_context.Script.node ->
(ex_ty * Alpha_context.context)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresultval parse_view_output_ty :
Alpha_context.context ->
stack_depth:int ->
legacy:bool ->
Alpha_context.Script.node ->
(ex_ty * Alpha_context.context)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresultval parse_view :
?type_logger:type_logger ->
Alpha_context.context ->
legacy:bool ->
('storage, _) Script_typed_ir.ty ->
Script_typed_ir.view ->
('storage typed_view * Alpha_context.context)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tval parse_views :
?type_logger:type_logger ->
Alpha_context.context ->
legacy:bool ->
('storage, _) Script_typed_ir.ty ->
Script_typed_ir.view_map ->
('storage typed_view_map * Alpha_context.context)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tval parse_any_ty :
Alpha_context.context ->
legacy:bool ->
Alpha_context.Script.node ->
(ex_ty * Alpha_context.context)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresultparse_ty allowing big_map values, operations, contract and tickets.
val parse_ty :
Alpha_context.context ->
legacy:bool ->
allow_lazy_storage:bool ->
allow_operation:bool ->
allow_contract:bool ->
allow_ticket:bool ->
Alpha_context.Script.node ->
(ex_ty * Alpha_context.context)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresultWe expose parse_ty for convenience to external tools. Please use specialized versions such as parse_packable_ty, parse_passable_ty, parse_comparable_ty, or parse_big_map_value_ty if possible.
val unparse_ty :
loc:'loc ->
Alpha_context.context ->
('a, _) Script_typed_ir.ty ->
('loc Alpha_context.Script.michelson_node * Alpha_context.context)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresultval unparse_comparable_ty :
loc:'loc ->
Alpha_context.context ->
'a Script_typed_ir.comparable_ty ->
('loc Alpha_context.Script.michelson_node * Alpha_context.context)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresultval ty_of_comparable_ty :
'a Script_typed_ir.comparable_ty ->
('a, Dependent_bool.yes) Script_typed_ir.tyval parse_toplevel :
Alpha_context.context ->
legacy:bool ->
Alpha_context.Script.expr ->
(toplevel * Alpha_context.context)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tval unparse_parameter_ty :
loc:'loc ->
Alpha_context.context ->
('a, _) Script_typed_ir.ty ->
entrypoints:'a Script_typed_ir.entrypoints ->
('loc Alpha_context.Script.michelson_node * Alpha_context.context)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresultval typecheck_code :
legacy:bool ->
show_types:bool ->
Alpha_context.context ->
Alpha_context.Script.expr ->
(Script_tc_errors.type_map * Alpha_context.context)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tHigh-level function to typecheck a Michelson script. This function is not used for validating operations but only for the typecheck_code RPC.
If show_types is set to true, details of the typechecking are returned in the type_map, otherwise the returned type_map is empty.
val parse_code :
?type_logger:type_logger ->
Alpha_context.context ->
legacy:bool ->
code:Alpha_context.Script.lazy_expr ->
(ex_code * Alpha_context.context)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tval parse_storage :
?type_logger:type_logger ->
Alpha_context.context ->
legacy:bool ->
allow_forged:bool ->
('storage, _) Script_typed_ir.ty ->
storage:Alpha_context.Script.lazy_expr ->
('storage * Alpha_context.context)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tval parse_script :
?type_logger:type_logger ->
Alpha_context.context ->
legacy:bool ->
allow_forged_in_storage:bool ->
Alpha_context.Script.t ->
(ex_script * Alpha_context.context)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tCombines parse_code and parse_storage
val parse_and_unparse_script_unaccounted :
Alpha_context.context ->
legacy:bool ->
allow_forged_in_storage:bool ->
unparsing_mode ->
normalize_types:bool ->
Alpha_context.Script.t ->
(Alpha_context.Script.t * Alpha_context.context)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tval parse_contract :
Alpha_context.context ->
Alpha_context.Script.location ->
('a, _) Script_typed_ir.ty ->
Alpha_context.Destination.t ->
entrypoint:Alpha_context.Entrypoint.t ->
(Alpha_context.context * 'a Script_typed_ir.typed_contract)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tval parse_contract_for_script :
Alpha_context.context ->
Alpha_context.Script.location ->
('a, _) Script_typed_ir.ty ->
Alpha_context.Destination.t ->
entrypoint:Alpha_context.Entrypoint.t ->
(Alpha_context.context * 'a Script_typed_ir.typed_contract option)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.ttype 'a ex_ty_cstr = | Ex_ty_cstr : {ty : ('b, _) Script_typed_ir.ty;construct : 'b -> 'a;original_type_expr : Alpha_context.Script.node;
} -> 'a ex_ty_cstr
'a ex_ty_cstr is like ex_ty, but also adds to the existential a function used to reconstruct a value of type 'a from the internal type of the existential. Typically, it will be used to go from the type of an entry-point to the full type of a contract.
val find_entrypoint :
error_details:'error_trace Script_tc_errors.error_details ->
('t, _) Script_typed_ir.ty ->
't Script_typed_ir.entrypoints ->
Alpha_context.Entrypoint.t ->
('t ex_ty_cstr, 'error_trace) Gas_monad.tval list_entrypoints_uncarbonated :
('t, _) Script_typed_ir.ty ->
't Script_typed_ir.entrypoints ->
Michelson_v1_primitives.prim list list
* (ex_ty * Alpha_context.Script.node) Alpha_context.Entrypoint.Map.tval pack_data :
Alpha_context.context ->
('a, _) Script_typed_ir.ty ->
'a ->
(bytes * Alpha_context.context)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tval hash_comparable_data :
Alpha_context.context ->
'a Script_typed_ir.comparable_ty ->
'a ->
(Script_expr_hash.t * Alpha_context.context)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tval collect_lazy_storage :
Alpha_context.context ->
('a, _) Script_typed_ir.ty ->
'a ->
(lazy_storage_ids * Alpha_context.context)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresultTraverse the given type, producing a lazy_storage_ids for use with extract_lazy_storage_diff.
val extract_lazy_storage_diff :
Alpha_context.context ->
unparsing_mode ->
temporary:bool ->
to_duplicate:lazy_storage_ids ->
to_update:lazy_storage_ids ->
('a, _) Script_typed_ir.ty ->
'a ->
('a * Alpha_context.Lazy_storage.diffs option * Alpha_context.context)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tProduce a lazy storage diff, containing in-memory writes to lazy data structures such as big_maps yet to be committed.
The resulting diff can be committed to the underlying storage (context) using Lazy_storage_diff.apply.
val get_single_sapling_state :
Alpha_context.context ->
('a, _) Script_typed_ir.ty ->
'a ->
(Alpha_context.Sapling.Id.t option * Alpha_context.context)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresultval code_size :
Alpha_context.context ->
('a, 'b) Script_typed_ir.lambda ->
Script_typed_ir.view_map ->
(Cache_memory_helpers.sint * Alpha_context.context)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresultcode_size ctxt code views returns an overapproximation of the size of the in-memory representation of code and views in bytes in the context ctxt.
script_size script returns an overapproximation of the size of the in-memory representation of script in bytes as well as the cost associated to computing that overapproximation.