package tezt-tezos

  1. Overview
  2. Docs

Mempool filter configuration.

type t = {
  1. minimal_fees : int option;
  2. minimal_nanotez_per_gas_unit : (int * int) option;
  3. minimal_nanotez_per_byte : (int * int) option;
  4. replace_by_fee_factor : (int * int) option;
  5. max_operations : int option;
  6. max_total_bytes : int option;
}

Representation of the mempool configuration. None means that the field has been or will be omitted in the json encoding, in which case they are equal to the default values given below.

val to_string : t -> string

Build the Ezjsonm representation then encode it as a string.

val check_equal : t -> t -> unit

Call Check.( = ) on two configurations.

val of_json : Tezt_wrapper.JSON.t -> t

Return the config corresponding to the given json. If any field is missing, it is set to None.

val default_minimal_fees : int

Default value for the minimal_fees field (see src/proto_alpha/lib_plugin/plugin.ml)

val default_minimal_nanotez_per_gas_unit : int * int

Default value for the minimal_nanotez_per_gas_unit field (see src/proto_alpha/lib_plugin/plugin.ml)

val default_minimal_nanotez_per_byte : int * int

Default value for the minimal_nanotez_per_byte field (see src/proto_alpha/lib_plugin/plugin.ml)

val default_replace_by_fee_factor : int * int

Default value for the replace_by_fee_factor field (see src/proto_alpha/lib_plugin/plugin.ml)

val default_max_operations : int

Default value for the max_operations field (see src/lib_shell/prevalidator_bounding.ml)

val default_max_total_bytes : int

Default value for the max_total_bytes field (see src/lib_shell/prevalidator_bounding.ml)

val default : t

Configuration where each field is explicitely set to its default value.

val fill_with_default : t -> t

Returns a copy of the given filter config, where missing fields (i.e. containing None) have been set to their default value.

val call_get_filter : ?endpoint:Client.endpoint -> ?hooks:Tezt_wrapper.Process.hooks -> ?include_default:bool -> Client.t -> Tezt_wrapper.JSON.t Lwt.t

Call the RPC GET /chains/main/mempool/filter with query parameter include_default.

val check_get_filter_all_variations : ?log:bool -> ?endpoint:Client.endpoint -> ?hooks:Tezt_wrapper.Process.hooks -> t -> Client.t -> unit Lwt.t

Check that the RPC GET /chains/main/mempool/filter returns the json corresponding to the provided t, testing all possibilities for the optional argument include_default (omitted/true/false).

val post_filter : ?log:bool -> ?endpoint:Client.endpoint -> ?hooks:Tezt_wrapper.Process.hooks -> t -> Client.t -> Tezt_wrapper.JSON.t Lwt.t

Call the RPC POST /chains/main/mempool/filter with data set to the json representation of the given config t.

  • parameter log

    When true, log the input config at the info level. Defaults to false.

val post_filter_str : ?log:bool -> ?endpoint:Client.endpoint -> ?hooks:Tezt_wrapper.Process.hooks -> string -> Client.t -> Tezt_wrapper.JSON.t Lwt.t

Same as post_filter but takes the data config as a string.

val set_filter : ?log:bool -> ?endpoint:Client.endpoint -> ?hooks:Tezt_wrapper.Process.hooks -> ?minimal_fees:int -> ?minimal_nanotez_per_gas_unit:(int * int) -> ?minimal_nanotez_per_byte:(int * int) -> ?replace_by_fee_factor:(int * int) -> ?max_operations:int -> ?max_total_bytes:int -> Client.t -> unit Lwt.t

Set the mempool filter config to the provided parameters. Note that every omitted parameter will be set back to its default value, even if it previously held a different value.

More precisely, call post_filter on the config corresponding to the arguments named after config fields. Then, check that the config returned by the RPC is the same as the input one (where each omitted field has been filled with its default value).

OCaml

Innovation. Community. Security.