Mavryk_shell.Prevalidator_pending_operationsThis type is used for data representing pending operations of the prevalidator. Any iterator on this structure will process operations with `High priority first, followed by `Medium and finally `Low priority.
module Sized_set :
Mavryk_base.Sized.SizedSet
with type set := Mavryk_base.TzPervasives.Operation_hash.Set.tThis module implements a sized-set data-structure.
val empty : 'protocol_data tThe empty structure of pending operations.
val hashes : 'protocol_data t -> Mavryk_base.TzPervasives.Operation_hash.Set.thashes p returns the set of hashes contained in p
val operations :
'protocol_data t ->
'protocol_data Shell_operation.operation
Mavryk_base.TzPervasives.Operation_hash.Map.toperations p returns the Map of bindings oph -> op contained in p
val is_empty : 'protocol_data t -> boolis_empty p returns true if p has operations, false otherwise.
val mem : Mavryk_base.TzPervasives.Operation_hash.t -> 'protocol_data t -> boolmem oph p returns true if oph is found in p, false otherwise.
Complexity is O(log(n)), where n is the number of operations (hashes) in the structure.
val add :
'protocol_data Shell_operation.operation ->
status_and_priority ->
'protocol_data t ->
'protocol_data tadd oph op p status_and_priority records the operation op whose hash is oph and whose status and priority is status_and_priority in p.
Complexity is O(log(n)), where n is the number of operations (hashes) in the structure.
It is unspecified behaviour to call this function with a hash (oph) which is already recorded in the data-structure (p). It is your responsibility as the caller of the function to ensure this.
val remove :
Mavryk_base.TzPervasives.Operation_hash.t ->
'protocol_data t ->
'protocol_data tremove oph op p removes the binding oph from p.
Complexity is O(log(n)), where n is the number of operations (hashes) in the structure.
val cardinal : 'protocol_data t -> intcardinal p returns the number of operations (hashes) in p.
Complexity is O(n), where n is the number of operations (hashes) in the structure.
val fold :
(status_and_priority ->
Mavryk_base.TzPervasives.Operation_hash.t ->
'protocol_data Shell_operation.operation ->
'a ->
'a) ->
'protocol_data t ->
'a ->
'afold f p acc applies the function f on every binding oph |-> op of status and priority status_and_priority in p. The acc is passed to and (possibly) updated by every call to f.
We iterate on operations with the following order:
For operations with the same priority, the iteration order is defined Operation_hash.compare function (operations with small hashes are processed first).
val iter :
(status_and_priority ->
Mavryk_base.TzPervasives.Operation_hash.t ->
'protocol_data Shell_operation.operation ->
unit) ->
'protocol_data t ->
unititer f p is similar to fold where acc is unit
val fold_es :
(status_and_priority ->
Mavryk_base.TzPervasives.Operation_hash.t ->
'protocol_data Shell_operation.operation ->
'a ->
('a, 'b) Stdlib.result Lwt.t) ->
'protocol_data t ->
'a ->
('a, 'b) Stdlib.result Lwt.tfold_es f p acc is the Lwt version of fold, except that fold_es returns wihtout iterating over all the elements of the list as soon as a value Error e is returned by f