package octez-smart-rollup-node-lib

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Octez_smart_rollup_node.PurposeSource

Purposes for operators, indicating their role and thus the kinds of operations that they sign.

Sourcetype ex_purpose =
  1. | Purpose : 'a t -> ex_purpose

existential type for purpose.

Sourceval all : ex_purpose list

List of possible purposes for operator specialization.

Sourcemodule Map : Tezos_base.TzPervasives.Map.S with type key = ex_purpose

Operator type. An operator is either a single key or a list of keys.

Sourcetype ex_operator =
  1. | Operator : 'a operator -> ex_operator

existential type for operator.

Sourcetype operators = private ex_operator Map.t

operators type is a map from purpose to operator. This type is private to control its creation and make sure `kind t and `kind operator are correctly related with `kind

Sourcetype Tezos_base.TzPervasives.error +=
  1. | Missing_operator of ex_purpose
  2. | Too_many_operators of {
    1. expected_purposes : ex_purpose list;
    2. given_operators : operators;
    }
Sourceval to_string_ex_purpose : ex_purpose -> string

to_string_ex_purpose p returns a string representation of purpose p.

Sourceval pp : Format.formatter -> 'a t -> unit
Sourceval pp_ex_purpose : Format.formatter -> ex_purpose -> unit
Sourceval of_string_ex_purpose : string -> ex_purpose option

of_string_ex_purpose s parses a purpose from the given string s.

Sourceval of_string_exn_ex_purpose : string -> ex_purpose

of_string_exn_ex_purpose s parses a purpose from the given string s.

Sourceval operators_encoding : operators Tezos_base.TzPervasives.Data_encoding.t

make_operator ?default ~needed_purposes operators constructs a purpose map from a list of bindings operators, with a potential default key. If operators does not cover all purposes of needed_purposes and does not contains a default key then fails.

replace_operator ?default_operator ~needed_purposes purposed_keys operators replaces keys of operators by default_operator if it's set or by the purposed key in purposed_keys. It does nothing if default_operator is not set or purposed_keys is empty. Similar to make_operator the returns operators contains only mapping of purpose from needed_purposes.

Sourceval operation_kind : ex_purpose -> Operation_kind.t list

For each purpose, it returns a list of associated operation kinds.

Sourceval of_operation_kind : Operation_kind.t list -> ex_purpose list

For a list of operation kind, it returns a list of associated purpose.

Sourceval find_operator : 'kind t -> operators -> 'kind operator option

find_operator purpose operators returns the operator for the purpose from the operators list. The 'kind type is to know if this purpose allows only one or multiple operators.

mem_operator operator operators checks of operator is part of any purpose in operators.

Sourceval operators_bindings : operators -> (ex_purpose * ex_operator) list

function to bypass the private type. The opposite is not exposed so we don't risk corrupting the map with invalid 'kind1 purpose_kind -> 'kind2 operator mapping where 'kind1 <> 'kind2

OCaml

Innovation. Community. Security.