package tezos-protocol-015-PtLimaPt
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=7062cd57addd452852598a2214ade393130efa087b99068d53713bdf912b3680
sha512=08e4091144a03ce3c107fb91a66501bd8b65ca3278917c455a2eaac6df3e108ade63f6ab8340a4bb152d60f404326e464d0ec95d26cafe8e82f870465d24a5fc
doc/tezos-protocol-015-PtLimaPt.raw/Tezos_raw_protocol_015_PtLimaPt/Script_ir_translator/index.html
Module Tezos_raw_protocol_015_PtLimaPt.Script_ir_translator
Source
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 ('a, 's, 'b, 'u) cinstr = {
apply : 'r 'f. ('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;
}
val ty_eq :
error_details:
(Alpha_context.Script.location, 'error_trace)
Script_tc_errors.error_details ->
('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.t
High-level Michelson Data Types
val parse_comparable_data :
?type_logger:Script_ir_translator_config.type_logger ->
Alpha_context.context ->
'a Script_typed_ir.comparable_ty ->
Alpha_context.Script.node ->
('a * Alpha_context.context)
Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult
Tezos_protocol_environment_015_PtLimaPt.Lwt.t
Parsing and Typechecking Michelson
val parse_data :
elab_conf:Script_ir_translator_config.elab_config ->
Alpha_context.context ->
allow_forged:bool ->
('a, _) Script_typed_ir.ty ->
Alpha_context.Script.node ->
('a * Alpha_context.context)
Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult
Tezos_protocol_environment_015_PtLimaPt.Lwt.t
For benchmarking purpose, we also export versions of the unparsing functions which don't call location stripping. These functions are not carbonated and should not be called directly from the protocol.
val parse_instr :
elab_conf:Script_ir_translator_config.elab_config ->
tc_context ->
Alpha_context.context ->
Alpha_context.Script.node ->
('a, 's) Script_typed_ir.stack_ty ->
(('a, 's) judgement * Alpha_context.context)
Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult
Tezos_protocol_environment_015_PtLimaPt.Lwt.t
val parse_big_map_value_ty :
Alpha_context.context ->
legacy:bool ->
Alpha_context.Script.node ->
(Script_typed_ir.ex_ty * Alpha_context.context)
Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult
parse_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 ->
(Script_typed_ir.ex_ty * Alpha_context.context)
Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult
val parse_passable_ty :
Alpha_context.context ->
legacy:bool ->
Alpha_context.Script.node ->
(Script_typed_ir.ex_ty * Alpha_context.context)
Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult
val parse_comparable_ty :
Alpha_context.context ->
Alpha_context.Script.node ->
(ex_comparable_ty * Alpha_context.context)
Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult
val 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_015_PtLimaPt.Error_monad.tzresult
val parse_view_input_ty :
Alpha_context.context ->
stack_depth:int ->
legacy:bool ->
Alpha_context.Script.node ->
(Script_typed_ir.ex_ty * Alpha_context.context)
Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult
val parse_view_output_ty :
Alpha_context.context ->
stack_depth:int ->
legacy:bool ->
Alpha_context.Script.node ->
(Script_typed_ir.ex_ty * Alpha_context.context)
Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult
val parse_view :
elab_conf:Script_ir_translator_config.elab_config ->
Alpha_context.context ->
('storage, _) Script_typed_ir.ty ->
Script_typed_ir.view ->
('storage typed_view * Alpha_context.context)
Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult
Tezos_protocol_environment_015_PtLimaPt.Lwt.t
val parse_views :
elab_conf:Script_ir_translator_config.elab_config ->
Alpha_context.context ->
('storage, _) Script_typed_ir.ty ->
Script_typed_ir.view_map ->
('storage typed_view_map * Alpha_context.context)
Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult
Tezos_protocol_environment_015_PtLimaPt.Lwt.t
val parse_any_ty :
Alpha_context.context ->
legacy:bool ->
Alpha_context.Script.node ->
(Script_typed_ir.ex_ty * Alpha_context.context)
Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult
parse_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 ->
(Script_typed_ir.ex_ty * Alpha_context.context)
Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult
We 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 parse_toplevel :
Alpha_context.context ->
legacy:bool ->
Alpha_context.Script.expr ->
(toplevel * Alpha_context.context)
Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult
Tezos_protocol_environment_015_PtLimaPt.Lwt.t
val 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_015_PtLimaPt.Error_monad.tzresult
Tezos_protocol_environment_015_PtLimaPt.Lwt.t
High-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_storage :
elab_conf:Script_ir_translator_config.elab_config ->
Alpha_context.context ->
allow_forged:bool ->
('storage, _) Script_typed_ir.ty ->
storage:Alpha_context.Script.lazy_expr ->
('storage * Alpha_context.context)
Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult
Tezos_protocol_environment_015_PtLimaPt.Lwt.t
val parse_script :
elab_conf:Script_ir_translator_config.elab_config ->
Alpha_context.context ->
allow_forged_in_storage:bool ->
Alpha_context.Script.t ->
(ex_script * Alpha_context.context)
Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult
Tezos_protocol_environment_015_PtLimaPt.Lwt.t
Combines parse_code
and parse_storage
val parse_and_unparse_script_unaccounted :
Alpha_context.context ->
legacy:bool ->
allow_forged_in_storage:bool ->
Script_ir_unparser.unparsing_mode ->
normalize_types:bool ->
Alpha_context.Script.t ->
(Alpha_context.Script.t * Alpha_context.context)
Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult
Tezos_protocol_environment_015_PtLimaPt.Lwt.t
val parse_contract_data :
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_015_PtLimaPt.Error_monad.tzresult
Tezos_protocol_environment_015_PtLimaPt.Lwt.t
val 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_015_PtLimaPt.Error_monad.tzresult
Tezos_protocol_environment_015_PtLimaPt.Lwt.t
type '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.t
val list_entrypoints_uncarbonated :
('t, _) Script_typed_ir.ty ->
't Script_typed_ir.entrypoints ->
Michelson_v1_primitives.prim list list
* (Script_typed_ir.ex_ty * Alpha_context.Script.node)
Alpha_context.Entrypoint.Map.t
val pack_data :
Alpha_context.context ->
('a, _) Script_typed_ir.ty ->
'a ->
(bytes * Alpha_context.context)
Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult
Tezos_protocol_environment_015_PtLimaPt.Lwt.t
val hash_comparable_data :
Alpha_context.context ->
'a Script_typed_ir.comparable_ty ->
'a ->
(Script_expr_hash.t * Alpha_context.context)
Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult
Tezos_protocol_environment_015_PtLimaPt.Lwt.t
val collect_lazy_storage :
Alpha_context.context ->
('a, _) Script_typed_ir.ty ->
'a ->
(lazy_storage_ids * Alpha_context.context)
Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult
Traverse the given type, producing a lazy_storage_ids
for use with extract_lazy_storage_diff
.
val extract_lazy_storage_diff :
Alpha_context.context ->
Script_ir_unparser.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_015_PtLimaPt.Error_monad.tzresult
Tezos_protocol_environment_015_PtLimaPt.Lwt.t
Produce 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_015_PtLimaPt.Error_monad.tzresult
val 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_015_PtLimaPt.Error_monad.tzresult
code_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.