package tezt-tezos

  1. Overview
  2. Docs
type t

EVM proxy server state.

val create : ?runner:Tezt.Runner.t -> ?rpc_addr:string -> ?rpc_port:int -> Sc_rollup_node.t -> t

create ?runner ?rpc_addr ?rpc_port rollup_node creates an EVM proxy server.

The server listens to requests at address rpc_addr and the port rpc_port. rpc_addr defaults to "127.0.0.1" and a fresh port is chosen if rpc_port is not set.

The server communicates with a rollup-node and sets its endpoint via rollup_node.

val mockup : ?runner:Tezt.Runner.t -> ?rpc_addr:string -> ?rpc_port:int -> unit -> t

mockup ?runner ?rpc_addr ?rpc_port () is like create but doesn't communicate with a rollup_node and serves mockup values.

val run : t -> unit Lwt.t

run proxy_server launches the EVM proxy server with the arguments given during create.

val init : ?runner:Tezt.Runner.t -> ?rpc_addr:string -> ?rpc_port:int -> Sc_rollup_node.t -> t Lwt.t

init ?runner ?rpc_addr ?rpc_port rollup_node creates an EVM proxy server with create and runs it with run.

val spawn_run : t -> Tezt.Process.t

spawn_run proxy_server same as run but spawns a process.

val endpoint : t -> string

endpoint proxy_server returns the endpoint to communicate with the proxy_server.

type request = {
  1. method_ : string;
  2. parameters : Tezt.JSON.u;
}

JSON-RPC request.

val call_evm_rpc : t -> request -> Tezt.JSON.t Lwt.t

call_evm_rpc proxy_server ~request sends a JSON-RPC request to the proxy_server, for the given request.

val batch_evm_rpc : t -> request list -> Tezt.JSON.t Lwt.t

batch_evm_rpc proxy_server ~requests sends multiple JSON-RPC requests to the proxy_server, for the given requests.

val extract_result : Tezt.JSON.t -> Tezt.JSON.t

extract_result json expects a JSON-RPC `result` and returns the value.

val fetch_contract_code : t -> string -> string Lwt.t

fetch_contract_code proxy_server contract returns the code associated to the given contract in the rollup.

type txpool_slot = {
  1. address : string;
  2. transactions : (int64 * Tezt.JSON.t) list;
}

A slot in the transaction pool associates an address to a mapping of nonces to transactions.

val txpool_content : t -> (txpool_slot list * txpool_slot list) Lwt.t

txpool_content proxy_server returns the transaction hash and nonce contained in the `pending` and `queued` pools.

OCaml

Innovation. Community. Security.