Store.Protocol
The module for handling protocol-related operations.
val mem : store -> Mavryk_base.TzPervasives.Protocol_hash.t -> bool
mem global_store ph
checks the existence of the protocol ph
in global_store
.
val all : store -> Mavryk_base.TzPervasives.Protocol_hash.Set.t
all global_store ph
returns the set of all stored protocol in global_store
.
val read :
store ->
Mavryk_base.TzPervasives.Protocol_hash.t ->
Mavryk_base.TzPervasives.Protocol.t option Lwt.t
read global_store ph
reads the protocol ph
from the global_store
. Returns None
if it does not exist.
val store :
store ->
Mavryk_base.TzPervasives.Protocol_hash.t ->
Mavryk_base.TzPervasives.Protocol.t ->
Mavryk_base.TzPervasives.Protocol_hash.t option Lwt.t
store global_store ph protocol
stores the protocol
under the hash ph
in the global_store
. Returns None
if it already exists or Some ph
if it was correctly stored.
Warning No hash check is made, the caller must be careful when storing protocols.
val store_raw :
store ->
Mavryk_base.TzPervasives.Protocol_hash.t ->
bytes ->
Mavryk_base.TzPervasives.Protocol_hash.t option Lwt.t
store_raw global_store ph bytes
raw version of store
.
val protocol_watcher :
store ->
Mavryk_base.TzPervasives.Protocol_hash.t Lwt_stream.t * Lwt_watcher.stopper
protocol_watcher global_store
instantiates a new protocol watcher in global_store
.