package octez-proto-libs
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=55ea1fb8bb3273a7fc270ca8f650d45c56449665619482aad9bc12f3ea736b7e
sha512=fec850fc2d17d7490bbabd5147d62aad13b3aaed8774270f8a38ab419670ed03e0fd30cf8642a97984eca5c2446726fe590ad99c015f7ec50919dc7652f25053
doc/octez-proto-libs.protocol-environment/Tezos_protocol_environment/Proxy_context/index.html
Module Tezos_protocol_environment.Proxy_context
Source
This module is the location where the proxy tweaks the behavior of a vanilla client. A regular mockup client uses a Memory_context
in place of this implementation. Compared to Memory_context
, this instance features a Proxy_Delegate.T
which under the hood relies on Proxy_getter
.
Other *_context
modules of Tezos_protocol_environment
, i.e. siblings of this file, are backed by different type of values coming from Tezos_context
. This file is backed by M.t
below, which is a thin layer over Tezos_memory_context.Context
. Because of that, this instance of Tezos_protocol_environment
is close to the Memory_context
one.
Whereas Memory_context
is a regular recursive map, Proxy_context
obtains values by delegating to endpoints when receiving requests. Hence, right after having created an empty
value with an instance of Proxy_Delegate.T
, this value behaves as the distant endpoint it delegates to.
The module by which to parameterize Environment_context.Context.kind
below.
type Tezos_protocol_environment__.Environment_context.Context.kind +=
| Context : M.t Tezos_protocol_environment__.Environment_context.Context.kind
The additional kind identifying Proxy_context
values. Used to detect at runtime when a proxy context is expected, to disambiguate from other kinds.
val empty :
Proxy_delegate.t option ->
Tezos_protocol_environment__.Environment_context.Context.t
Constructs an empty context, possibly giving the delegate (the function querying the endpoint) right away. Otherwise set it later with set delegate