package octez-l2-libs
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=ddfb5076eeb0b32ac21c1eed44e8fc86a6743ef18ab23fff02d36e365bb73d61
sha512=d22a827df5146e0aa274df48bc2150b098177ff7e5eab52c6109e867eb0a1f0ec63e6bfbb0e3645a6c2112de3877c91a17df32ccbff301891ce4ba630c997a65
doc/octez-l2-libs.webassembly-interpreter/Tezos_webassembly_interpreter/Output_buffer/index.html
Module Tezos_webassembly_interpreter.Output_buffer
This module implements a bounded FIFO queue to model the outputs. Each element of the queue is a list of outbox messages produced on this level.
type output_info = {outbox_level : int32;(*The outbox level at which the message exists.
*)message_index : Z.t;(*The index of the message in the outbox.
*)
}module Messages = Tezos_lazy_containers.Lazy_vector.Mutable.ZVectormodule Outboxes = Tezos_lazy_containers.Lazy_map.Mutable.LwtInt32Maptype t = {outboxes : bytes Messages.t Outboxes.t;mutable last_level : int32 option;validity_period : int32;message_limit : Z.t;(*Limit of messages per outbox
*)
}alloc ~validity_period ~last_level allocates a new output_buffer. If last_level is Some level, the corresponding outbox is allocated.
val is_initialized : t -> boolis_initialized buffer returns true if the output buffer has been initialized.
val initialize_outbox : t -> int32 -> unitinitialize_outbox buffer level initialize the output_buffer with a fresh inbox at the given level.
val move_outbox_forward : t -> unitmove_outbox_forward outboxes increments the last level of the outbox, allocates a new outbox and removes the outbox at the previous first level, according to the validity period.
val push_message : t -> bytes -> output_info Lwt.tpush_message outboxes msg push a new message in the last outbox, and returns the its level and index in the outbox.
val get_outbox : t -> int32 -> bytes Messages.Vector.t Lwt.tget_outbox outboxes level returns the outbox for the given level.
val get_message : t -> output_info -> bytes Lwt.tget_message outboxes message_info finds a message in the output buffer.
sandbox outboxes create a snapshot of the outbox. You can modify original one, snapshotted one will stay untouched.
module Internal_for_tests : sig ... end