package octez-proto-libs
- Overview
- No Docs
You can search for identifiers within the package.
in-package search v0.2.0
Install
    
    dune-project
 Dependency
Authors
Maintainers
Sources
sha256=aa2f5bc99cc4ca2217c52a1af2a2cdfd3b383208cb859ca2e79ca0903396ca1d
    
    
  sha512=d68bb3eb615e3dcccc845fddfc9901c95b3c6dc8e105e39522ce97637b1308a7fa7aa1d271351d5933febd7476b2819e1694f31198f1f0919681f1f9cc97cb3a
    
    
  doc/octez-proto-libs.protocol-environment/Tezos_protocol_environment/Memory_context/index.html
Module Tezos_protocol_environment.Memory_contextSource
Memory_context is a recursive map backed by an in-memory Irmin tree, i.e. Tezos_context_memory.Context (in src/lib_context), used by the mockup mode and by proof verifiers (i.e. clients of Tezos_context_helpers.Context.Make_tree.Proof). It abstracts away Tezos_context_memory.Context.t.
It is one of the instances of Environment_context along Shell_context and Proxy_context. All these 3 instances can implement the same API (i.e. Environment_context), because this API is highly polymorphic, thanks to Environment_context.Context.ops.
As such, a Memory_context value is an instance of Environment_context whose Environment_context.Context.kind is the one declared below in this file, i.e. Context.
Instances of t are easier to obtain than Shell_context (which are used by nodes), because they don't require access to a disk: they live completely in memory. That is why they are ideal for testing.
The type of the context backing Memory_context. Main use is the parameterization of Environment_context.Context.kind below, as well as the instantiation of the S signature below (the module type of M).
type Tezos_protocol_environment__.Environment_context.Context.kind += - | Context : t Tezos_protocol_environment__.Environment_context.Context.kind
The additional kind identifying Memory_context values. Used to detect at runtime when a memory context is expected, to disambiguate from other kinds.
empty creates a pristine memory context: a Protocol_environment.Context.t value whose kind indicates that it is a memory context. See wrap_memory_context for an alternative constructor.
val encoding : 
  Tezos_protocol_environment__.Environment_context.Context.t
    Tezos_base.TzPervasives.Data_encoding.tencoding is an appropriate encoding for Environment_context.Context.t values whose kind is Memory_context. This is used by the mockup for storing its state on disk. This is unique to Memory_context:
- Shell_contextis backed by an Irmin on-disk storage and so doesn't need its own serialization mechanism.
- Proxy_contextdoesn't need to be serializable.
wrap_memory_context t creates a memory context from an Irmin in-memory tree: in this signature, t comes from Tezos_context_memory.Context (in src/lib_context. See empty for an alternative constructor.