package octez-shell-libs

  1. Overview
  2. Docs
Octez shell libraries

Install

Dune Dependency

Authors

Maintainers

Sources

tezos-18.0.tar.gz
sha256=dbc3b675aee59c2c574e5d0a771193a2ecfca31e7a5bc5aed66598080596ce1c
sha512=b97ed762b9d24744305c358af0d20f394376b64bfdd758dd4a81775326caf445caa57c4f6445da3dd6468ff492de18e4c14af6f374dfcbb7e4d64b7b720e5e2a

doc/octez-shell-libs.shell/Tezos_shell/Prevalidator_pending_operations/index.html

Module Tezos_shell.Prevalidator_pending_operationsSource

Sourcetype priority = [
  1. | `High
  2. | `Medium
  3. | `Low of Q.t list
]

The priority of a pending operation.

A priority is attached to each pending operation.

Sourcetype 'protocol_data t

This 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.

Sourcemodule Sized_set : Tezos_base.Sized.SizedSet with type set := Tezos_base.TzPervasives.Operation_hash.Set.t

This module implements a sized-set data-structure.

Sourceval empty : 'protocol_data t

The empty structure of pending operations.

Sourceval hashes : 'protocol_data t -> Tezos_base.TzPervasives.Operation_hash.Set.t

hashes p returns the set of hashes contained in p

Sourceval operations : 'protocol_data t -> 'protocol_data Shell_operation.operation Tezos_base.TzPervasives.Operation_hash.Map.t

operations p returns the Map of bindings oph -> op contained in p

Sourceval is_empty : 'protocol_data t -> bool

is_empty p returns true if p has operations, false otherwise.

Sourceval mem : Tezos_base.TzPervasives.Operation_hash.t -> 'protocol_data t -> bool

mem 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.

Sourceval add : 'protocol_data Shell_operation.operation -> priority -> 'protocol_data t -> 'protocol_data t

add oph op p prio records the operation op whose hash is oph and whose priority is prio 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.

Sourceval remove : Tezos_base.TzPervasives.Operation_hash.t -> 'protocol_data t -> 'protocol_data t

remove 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.

Sourceval cardinal : 'protocol_data t -> int

cardinal p returns the number of operations (hashes) in p.

Complexity is O(n), where n is the number of operations (hashes) in the structure.

Sourceval fold : (priority -> Tezos_base.TzPervasives.Operation_hash.t -> 'protocol_data Shell_operation.operation -> 'a -> 'a) -> 'protocol_data t -> 'a -> 'a

fold f p acc applies the function f on every binding oph |-> op of priority prio in p. The acc is passed to and (possibly) updated by every call to f.

We iterate on operations with `High priority first, then on those with `Low priority. For operations with the same priority, the iteration order is defined Operation_hash.compare function (operations with small hashes are processed first).

Sourceval iter : (priority -> Tezos_base.TzPervasives.Operation_hash.t -> 'protocol_data Shell_operation.operation -> unit) -> 'protocol_data t -> unit

iter f p is similar to fold where acc is unit

Sourceval fold_es : (priority -> Tezos_base.TzPervasives.Operation_hash.t -> 'protocol_data Shell_operation.operation -> 'a -> ('a, 'b) result Lwt.t) -> 'protocol_data t -> 'a -> ('a, 'b) result Lwt.t

fold_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

OCaml

Innovation. Community. Security.