package tezos-protocol-environment

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Parameters

module Param : sig ... end

Signature

include Tezos_protocol_environment_sigs.V2.T with type Format.formatter = Stdlib.Format.formatter and type 'a Data_encoding.t = 'a Tezos_base__TzPervasives.Data_encoding.t and type 'a Data_encoding.lazy_t = 'a Tezos_base__TzPervasives.Data_encoding.lazy_t and type 'a Lwt.t = 'a Lwt.t and type ('a, 'b) Pervasives.result = ('a, 'b) Stdlib.result and type Chain_id.t = Tezos_base__TzPervasives.Chain_id.t and type Block_hash.t = Tezos_base__TzPervasives.Block_hash.t and type Operation_hash.t = Tezos_base__TzPervasives.Operation_hash.t and type Operation_list_hash.t = Tezos_base__TzPervasives.Operation_list_hash.t and type Operation_list_list_hash.t = Tezos_base__TzPervasives.Operation_list_list_hash.t and type Context.t = Environment_context.Context.t and type Context_hash.t = Tezos_base__TzPervasives.Context_hash.t and type Protocol_hash.t = Tezos_base__TzPervasives.Protocol_hash.t and type Time.t = Tezos_base__TzPervasives.Time.Protocol.t and type Operation.shell_header = Tezos_base__TzPervasives.Operation.shell_header and type Operation.t = Tezos_base__TzPervasives.Operation.t and type Block_header.shell_header = Tezos_base__TzPervasives.Block_header.shell_header and type Block_header.t = Tezos_base__TzPervasives.Block_header.t and type 'a RPC_directory.t = 'a Tezos_base__TzPervasives.RPC_directory.t and type Ed25519.Public_key_hash.t = Tezos_base__TzPervasives.Ed25519.Public_key_hash.t and type Ed25519.Public_key.t = Tezos_base__TzPervasives.Ed25519.Public_key.t and type Ed25519.t = Tezos_base__TzPervasives.Ed25519.t and type Secp256k1.Public_key_hash.t = Tezos_base__TzPervasives.Secp256k1.Public_key_hash.t and type Secp256k1.Public_key.t = Tezos_base__TzPervasives.Secp256k1.Public_key.t and type Secp256k1.t = Tezos_base__TzPervasives.Secp256k1.t and type P256.Public_key_hash.t = Tezos_base__TzPervasives.P256.Public_key_hash.t and type P256.Public_key.t = Tezos_base__TzPervasives.P256.Public_key.t and type P256.t = Tezos_base__TzPervasives.P256.t and type Signature.public_key_hash = Tezos_base__TzPervasives.Signature.public_key_hash and type Signature.public_key = Tezos_base__TzPervasives.Signature.public_key and type Signature.t = Tezos_base__TzPervasives.Signature.t and type Signature.watermark = Tezos_base__TzPervasives.Signature.watermark and type Pvss_secp256k1.Commitment.t = Tezos_base__TzPervasives.Pvss_secp256k1.Commitment.t and type Pvss_secp256k1.Encrypted_share.t = Tezos_base__TzPervasives.Pvss_secp256k1.Encrypted_share.t and type Pvss_secp256k1.Clear_share.t = Tezos_base__TzPervasives.Pvss_secp256k1.Clear_share.t and type Pvss_secp256k1.Public_key.t = Tezos_base__TzPervasives.Pvss_secp256k1.Public_key.t and type Pvss_secp256k1.Secret_key.t = Tezos_base__TzPervasives.Pvss_secp256k1.Secret_key.t and type 'a Micheline.canonical = 'a Tezos_micheline.Micheline.canonical and type Z.t = Z.t and type ('a, 'b) Micheline.node = ('a, 'b) Tezos_micheline.Micheline.node and type Data_encoding.json_schema = Tezos_base__TzPervasives.Data_encoding.json_schema and type ('a, 'b) RPC_path.t = ('a, 'b) Tezos_base__TzPervasives.RPC_path.t and type RPC_service.meth = Tezos_base__TzPervasives.RPC_service.meth and type (+'m, 'pr, 'p, 'q, 'i, 'o) RPC_service.t = ('m, 'pr, 'p, 'q, 'i, 'o) Tezos_base__TzPervasives.RPC_service.t and type Error_monad.shell_tztrace = Tezos_base__TzPervasives.Error_monad.tztrace and type 'a Error_monad.shell_tzresult = ('a, Tezos_base__TzPervasives.Error_monad.tztrace) Stdlib.result and module Sapling = Tezos_sapling.Core.Validator with type Context.t = Environment_context.Context.t with type Updater.validation_result = Environment_context.validation_result with type Updater.quota = Environment_context.quota with type Updater.rpc_context = Environment_context.rpc_context
module Pervasives : sig ... end
module List : sig ... end
module String : sig ... end
module Char : sig ... end
module Bytes : sig ... end
module Int32 : sig ... end
module Int64 : sig ... end
module Format : sig ... end
module Hex : sig ... end
module Z : sig ... end
module Lwt : sig ... end
module Lwt_list : sig ... end
module Data_encoding : sig ... end
module Raw_hashes : sig ... end
module Compare : sig ... end
module Error_monad : sig ... end
module Logging : sig ... end
module Time : sig ... end
module Option : sig ... end
module TzEndian : sig ... end
module Bits : sig ... end
module RPC_arg : sig ... end
module RPC_path : sig ... end
module RPC_query : sig ... end
module RPC_service : sig ... end
module RPC_answer : sig ... end
module RPC_directory : sig ... end
module Base58 : sig ... end
module S : sig ... end
module Set : sig ... end
module Map : sig ... end
module Blake2B : sig ... end
module Bls12_381 : sig ... end
module Ed25519 : sig ... end
module Secp256k1 : sig ... end
module P256 : sig ... end
module Chain_id : sig ... end
module Signature : sig ... end
module Block_hash : sig ... end
module Operation_hash : sig ... end
module Operation_list_hash : sig ... end
module Operation_list_list_hash : sig ... end
module Protocol_hash : sig ... end
module Context_hash : sig ... end
module Pvss_secp256k1 : sig ... end
module Sapling : sig ... end
module Micheline : sig ... end
module Block_header : sig ... end
module Fitness : sig ... end
module Operation : sig ... end
module Protocol : sig ... end
module Context : sig ... end
module Updater : sig ... end
module RPC_context : sig ... end
module Equality_witness : sig ... end
type Tezos_base__TzPervasives.error +=
  1. | Ecoproto_error of Error_monad.error

An Ecoproto_error e is a shell error that carry a protocol error.

Each protocol has its own error-monad (instantiated when this module here is applied) with a fresh extensible error type. This protocol-specific error type is incompatible with the shell's. The Ecoproto_error constructor belongs to the shell's error type and it carries the errors of the protocol's specific error type back into the shell's.

The function wrap_tz* below provide wrappers for three different levels: errors, traces, and tzresults. They are used within the implementation of the environment to translate some return values from the protocol's error monad into the shell's. They are exported because they can be useful for writing tests for the protocol (i.e., for the tests located in src/proto_*/lib_protocol/test/) and for writing protocol-specific support libraries and binaries (i.e., for the code in src/proto_*/lib_{client,delegate,etc.}).

wrap_tzerror e is a shell error wrapping the protocol error e. (It is Ecoproto_error e.)

wrap_tztrace t is a shell trace composed of the wrapped errors of the protocol trace t.

val wrap_tzresult : 'a Error_monad.tzresult -> ('a, Tezos_error_monad.TzCore.error list) Stdlib.result

wrap_tzresult r is a shell tzresult that carries the same result as or a wrapped trace of the protocol tzresult r. (It is Ok x if r is Ok x, it is Error (wrap_tztrace t) if r is Error t.)

class ['chain, 'block] proto_rpc_context : Tezos_rpc.RPC_context.t -> (unit, (unit * 'chain) * 'block) RPC_path.t -> ('chain * 'block) RPC_context.simple
OCaml

Innovation. Community. Security.