package tezos-protocol-015-PtLimaPt
Install
    
    dune-project
 Dependency
Authors
Maintainers
Sources
sha256=43723d096307603703a1a89ed1b2eb202b365f5e7824b96b0cbf813b343a6cf7
    
    
  sha512=b2a637f2e965000d3d49ad85277ca24d6cb07a1a7cf2bc69d296d8b03ad78c3eaa8e21e94b9162e62c2e11649cd03bc845b2a3dafe623b91065df69d47dc8e4f
    
    
  doc/tezos-protocol-015-PtLimaPt.raw/Tezos_raw_protocol_015_PtLimaPt/Script_interpreter/index.html
Module Tezos_raw_protocol_015_PtLimaPt.Script_interpreterSource
This is the Michelson interpreter.
This module offers a way to execute either a Michelson script or a Michelson instruction.
Implementation details are documented in the .ml file.
type Tezos_protocol_environment_015_PtLimaPt.Error_monad.error += - | Overflow of Alpha_context.Script.location * Script_typed_ir.execution_trace option
type Tezos_protocol_environment_015_PtLimaPt.Error_monad.error += - | Runtime_contract_error of Contract_hash.t
type Tezos_protocol_environment_015_PtLimaPt.Error_monad.error += - | Bad_contract_parameter of Alpha_context.Contract.t
type execution_result = {- script : Script_ir_translator.ex_script;
- code_size : int;
- storage : Alpha_context.Script.expr;
- lazy_storage_diff : Alpha_context.Lazy_storage.diffs option;
- operations : Script_typed_ir.packed_internal_operation list;
- ticket_diffs : Tezos_protocol_environment_015_PtLimaPt.Z.t Ticket_token_map.t;
- ticket_receipt : Alpha_context.Ticket_receipt.t;
}The result from script interpretation.
type step_constants = Script_typed_ir.step_constants = {- source : Alpha_context.Contract.t;
- payer : Tezos_protocol_environment_015_PtLimaPt.Signature.public_key_hash;
- self : Contract_hash.t;
- amount : Alpha_context.Tez.t;
- balance : Alpha_context.Tez.t;
- chain_id : Tezos_protocol_environment_015_PtLimaPt.Chain_id.t;
- now : Script_timestamp.t;
- level : Script_int.n Script_int.num;
}val execute : 
  ?logger:Script_typed_ir.logger ->
  Alpha_context.t ->
  cached_script:Script_ir_translator.ex_script option ->
  Script_ir_unparser.unparsing_mode ->
  step_constants ->
  script:Alpha_context.Script.t ->
  entrypoint:Alpha_context.Entrypoint.t ->
  parameter:Alpha_context.Script.expr ->
  internal:bool ->
  (execution_result * Alpha_context.context)
    Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult
    Tezos_protocol_environment_015_PtLimaPt.Lwt.texecute ?logger ctxt ~cached_script mode step_constant ~script ~entrypoint ~parameter ~internal interprets the script's entrypoint for a given parameter.
This will update the local storage of the contract step_constants.self. Other pieces of contextual information (source, payer, amount, and chaind_id) are also passed in step_constant.
internal is true if and only if the execution happens within an internal operation.
mode is the unparsing mode, as declared by Script_ir_translator.
cached_script is the cached elaboration of script, that is the well typed abstract syntax tree produced by the type elaboration of script during a previous execution and stored in the in-memory cache.
val execute_with_typed_parameter : 
  ?logger:Script_typed_ir.logger ->
  Alpha_context.context ->
  cached_script:Script_ir_translator.ex_script option ->
  Script_ir_unparser.unparsing_mode ->
  step_constants ->
  script:Alpha_context.Script.t ->
  entrypoint:Alpha_context.Entrypoint.t ->
  parameter_ty:('a, _) Script_typed_ir.ty ->
  location:Alpha_context.Script.location ->
  parameter:'a ->
  internal:bool ->
  (execution_result * Alpha_context.context)
    Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult
    Tezos_protocol_environment_015_PtLimaPt.Lwt.texecute_with_typed_parameter ?logger ctxt ~cached_script mode step_constant ~script ~entrypoint loc ~parameter_ty ~parameter ~internal interprets the script's entrypoint for a given (typed) parameter.
See execute for more details about the function's arguments.
Internal interpretation loop ============================
The following types and the following functions are exposed in the interface to allow the inference of a gas model in snoop.
Strictly speaking, they should not be considered as part of the interface since they expose implementation details that may change in the future.