package tezos-protocol-alpha
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=43723d096307603703a1a89ed1b2eb202b365f5e7824b96b0cbf813b343a6cf7
sha512=b2a637f2e965000d3d49ad85277ca24d6cb07a1a7cf2bc69d296d8b03ad78c3eaa8e21e94b9162e62c2e11649cd03bc845b2a3dafe623b91065df69d47dc8e4f
doc/tezos-protocol-alpha.raw/Tezos_raw_protocol_alpha/Script_ir_unparser/index.html
Module Tezos_raw_protocol_alpha.Script_ir_unparserSource
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 byScript_translator.parse_data.Readableproduces withstringvalues instead ofbyteswhen feasible.
type ('ty, 'depth) comb_witness = | Comb_Pair : ('t, 'd) comb_witness -> (_ * 't, unit -> 'd) comb_witness| Comb_Any : (_, _) comb_witness
('t, 'd) comb_witness describes types of values belonging to a comb of type 't and size 'd.
serialize_ty_for_error ty returns the Micheline representation of ty suitable for rendering in an error message. Does not consume gas, since when this function is called, the operation must have already failed.
val serialize_stack_for_error :
Alpha_context.context ->
('a, 'b) Script_typed_ir.stack_ty ->
Alpha_context.Script.expr listserialize_stack_for_error ctxt stack_ty returns a Micheline representation of stack_ty as a list of Micheline expressions ONLY IF gas is unlimited in ctxt. Otherwise returns an empty list.
val unparse_ty :
loc:'loc ->
Alpha_context.context ->
('b, 'c) Script_typed_ir.ty ->
('loc Alpha_context.Script.michelson_node * Alpha_context.context,
Tezos_protocol_environment_alpha.Error_monad.error
Tezos_protocol_environment_alpha.Error_monad.trace)
Tezos_protocol_environment_alpha.Pervasives.resultunparse_ty ~loc ctxt ty returns the Micheline representation of a given type and an update context, where gas has been properly consumed.
val unparse_comparable_ty_uncarbonated :
loc:'loc ->
'a Script_typed_ir.comparable_ty ->
'loc Alpha_context.Script.michelson_nodeunparse_comparable_ty_uncarbonated ~loc ty returns the Michelson representation of comparable type ty without consuming gas.
val unparse_stack_uncarbonated :
('a, 's) Script_typed_ir.stack_ty ->
Alpha_context.Script.expr listunparse_stack_uncarbonated stack_ty returns the Micheline representation of stack_ty. Does not consume gas.
val unparse_parameter_ty :
loc:'loc ->
Alpha_context.context ->
('a, 'c) Script_typed_ir.ty ->
entrypoints:'a Script_typed_ir.entrypoints ->
('loc Alpha_context.Script.michelson_node * Alpha_context.context,
Tezos_protocol_environment_alpha.Error_monad.error
Tezos_protocol_environment_alpha.Error_monad.trace)
Tezos_protocol_environment_alpha.Pervasives.resultunparse_parameter_ty ~loc ctxt ty ~entrypoints is a specialised version of unparse_ty, which also analyses entrypoints in order to annotate the returned type with adequate annotations.
val unparse_bls12_381_g1 :
loc:'loc ->
Alpha_context.context ->
Script_typed_ir.Script_bls.G1.t ->
('loc Alpha_context.Script.michelson_node * Alpha_context.context,
Tezos_protocol_environment_alpha.Error_monad.error
Tezos_protocol_environment_alpha.Error_monad.trace)
Tezos_protocol_environment_alpha.Pervasives.resultunparse_bls12_381_g1 ~loc ctxt bls returns the Micheline representation of bls and consumes gas from ctxt.
val unparse_bls12_381_g2 :
loc:'loc ->
Alpha_context.context ->
Script_typed_ir.Script_bls.G2.t ->
('loc Alpha_context.Script.michelson_node * Alpha_context.context,
Tezos_protocol_environment_alpha.Error_monad.error
Tezos_protocol_environment_alpha.Error_monad.trace)
Tezos_protocol_environment_alpha.Pervasives.resultunparse_bls12_381_g1 ~loc ctxt bls returns the Micheline representation of bls and consumes gas from ctxt.
val unparse_bls12_381_fr :
loc:'loc ->
Alpha_context.context ->
Script_typed_ir.Script_bls.Fr.t ->
('loc Alpha_context.Script.michelson_node * Alpha_context.context,
Tezos_protocol_environment_alpha.Error_monad.error
Tezos_protocol_environment_alpha.Error_monad.trace)
Tezos_protocol_environment_alpha.Pervasives.resultunparse_bls12_381_g1 ~loc ctxt bls returns the Micheline representation of bls and consumes gas from ctxt.
val unparse_operation :
loc:'loc ->
Alpha_context.context ->
Script_typed_ir.operation ->
('loc Alpha_context.Script.michelson_node * Alpha_context.context,
Tezos_protocol_environment_alpha.Error_monad.error
Tezos_protocol_environment_alpha.Error_monad.trace)
Tezos_protocol_environment_alpha.Pervasives.resultunparse_operation ~loc ctxt op returns the Micheline representation of op and consumes gas from ctxt. Useful only for producing execution traces in the interpreter.
val unparse_with_data_encoding :
loc:'loc ->
Alpha_context.context ->
'a ->
Alpha_context.Gas.cost ->
'a Tezos_protocol_environment_alpha.Data_encoding.t ->
('loc Alpha_context.Script.michelson_node * Alpha_context.context,
Tezos_protocol_environment_alpha.Error_monad.error
Tezos_protocol_environment_alpha.Error_monad.trace)
Tezos_protocol_environment_alpha.Pervasives.result
Tezos_protocol_environment_alpha.Lwt.tunparse_with_data_encoding ~loc ctxt v gas_cost enc returns the bytes representation of v wrapped in Micheline.Bytes, consuming gas_cost from ctxt.
val unparse_comparable_data :
Alpha_context.context ->
unparsing_mode ->
'a Script_typed_ir.comparable_ty ->
'a ->
(Alpha_context.Script.expr * Alpha_context.context)
Tezos_protocol_environment_alpha.Error_monad.tzresult
Tezos_protocol_environment_alpha.Lwt.tunparse_comparable_data ctxt unparsing_mode ty v returns the Micheline representation of v of type ty, consuming gas from ctxt.
val unparse_contract :
loc:'loc ->
Alpha_context.context ->
unparsing_mode ->
'b Script_typed_ir.typed_contract ->
('loc Alpha_context.Script.michelson_node * Alpha_context.context,
Tezos_protocol_environment_alpha.Error_monad.error
Tezos_protocol_environment_alpha.Error_monad.trace)
Tezos_protocol_environment_alpha.Pervasives.resultunparse_contract ~loc ctxt unparsin_mode contract returns a Micheline representation of a given contract in a given unparsing_mode. Consumes gas ctxt.
MICHESLON_PARSER signature describes a set of dependencies required to unparse arbitrary values in the IR. Because some of those values contain just a Michelson code that does not need to be parsed immediately, unparsing them requires extracting information from that code – that's why we depend on the parser here.