From 8df3286de1fdcb77ada290d1bf3778d7110638d8 Mon Sep 17 00:00:00 2001 From: Pierre-Emmanuel Cornilleau Date: Mon, 7 Apr 2025 11:18:36 +0200 Subject: [PATCH 1/2] Tezlink/tezt: update the /describe test to use octez-client for /tezlink --- etherlink/tezt/tests/evm_sequencer.ml | 22 ++++------ .../Alpha- Test the -describe endpoint.out | 44 +++++++++++++++++++ 2 files changed, 53 insertions(+), 13 deletions(-) diff --git a/etherlink/tezt/tests/evm_sequencer.ml b/etherlink/tezt/tests/evm_sequencer.ml index cf473523d228..80725bb1b9d6 100644 --- a/etherlink/tezt/tests/evm_sequencer.ml +++ b/etherlink/tezt/tests/evm_sequencer.ml @@ -10319,21 +10319,17 @@ let test_describe_endpoint = protocol in let hooks = Tezos_regression.hooks in - let endpoint = - Client.(Foreign_endpoint (Evm_node.rpc_endpoint_record sequencer)) + let sequencer_endpoint = Evm_node.rpc_endpoint_record sequencer in + (* List all the endpoint of the sequencer *) + let root_endpoint = Client.(Foreign_endpoint sequencer_endpoint) in + let* (_ : string) = Client.rpc_list ~hooks ~endpoint:root_endpoint client in + (* List the endpoints of the /tezlink directory *) + let tezlink_endpoint = + Client.(Foreign_endpoint {sequencer_endpoint with path = "/tezlink"}) in - let* (_ : string) = Client.rpc_list ~hooks ~endpoint client in - let path = "/tezlink/describe?recurse=yes" in - (* TODO replace with a call of octez-client when it supports a non empty - root see !17532 *) - let* res = - (* We check that the "/tezlink/describe" RPC is available. We don't record - the result in the regression trace because it is already contained in - the call to "/describe" above. *) - Curl.get_raw ~args:["-v"] (Evm_node.endpoint sequencer ^ path) - |> Runnable.run + let* (_ : string) = + Client.rpc_list ~hooks ~endpoint:tezlink_endpoint client in - let _ = JSON.parse ~origin:"curl_tezlink_describe" res in unit let test_relay_restricted_rpcs = diff --git a/etherlink/tezt/tests/expected/evm_sequencer.ml/Alpha- Test the -describe endpoint.out b/etherlink/tezt/tests/expected/evm_sequencer.ml/Alpha- Test the -describe endpoint.out index a08b05e6fea9..fd6bcd33bd9a 100644 --- a/etherlink/tezt/tests/expected/evm_sequencer.ml/Alpha- Test the -describe endpoint.out +++ b/etherlink/tezt/tests/expected/evm_sequencer.ml/Alpha- Test the -describe endpoint.out @@ -72,3 +72,47 @@ Warning: Failed to acquire the protocol version from the node Did not find service: GET http://[HOST]:[PORT]/chains/main/blocks/head/protocols + +./octez-client rpc list + +Available services: + + + chains//blocks// + - GET /chains//blocks//context/constants + All constants + - GET /chains//blocks//context/contracts//balance + The spendable balance of a contract (in mutez), also known as liquid + balance. Corresponds to tez owned by the contract that are neither + staked, nor in unstaked requests, nor in frozen bonds. Identical to + the 'spendable' RPC. + - GET /chains//blocks//helpers/current_level + Returns the level of the interrogated block, or the one of a block + located `offset` blocks after it in the chain. For instance, the next + block if `offset` is 1. The offset cannot be negative. + - GET /chains//blocks//protocols + Current and next protocol. + - GET /version + Get information on the node version + + +Dynamic parameter description: + + + A contract identifier encoded in b58check. + + A block identifier. This can take one of the following + values: + 1.Block-hash - Hash in Base58Check notation. + 2.Alias - One of + the following:'genesis/ head/ caboose/ savepoint/ + checkpoint'. + 3.Block-level - index(integer) in the chain. + One can + also specify the relative positions of block with respect to above + three block identifiers. For ex. 'checkpoint~N' or checkpoint+N, where + N is an integer, denotes the Nth block before(~) or after (+) the + checkpoint. + + A chain identifier. This is either a chain hash in Base58Check notation + or a one the predefined aliases: 'main', 'test'. + -- GitLab From 73ea440513da3a73884c2edaeb1611938ad4ee1d Mon Sep 17 00:00:00 2001 From: Pierre-Emmanuel CORNILLEAU Date: Mon, 14 Apr 2025 11:26:01 +0000 Subject: [PATCH 2/2] remove space --- .../evm_sequencer.ml/Alpha- Test the -describe endpoint.out | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etherlink/tezt/tests/expected/evm_sequencer.ml/Alpha- Test the -describe endpoint.out b/etherlink/tezt/tests/expected/evm_sequencer.ml/Alpha- Test the -describe endpoint.out index fd6bcd33bd9a..c4abd351c3f7 100644 --- a/etherlink/tezt/tests/expected/evm_sequencer.ml/Alpha- Test the -describe endpoint.out +++ b/etherlink/tezt/tests/expected/evm_sequencer.ml/Alpha- Test the -describe endpoint.out @@ -79,7 +79,7 @@ Available services: + chains//blocks// - GET /chains//blocks//context/constants - All constants + All constants - GET /chains//blocks//context/contracts//balance The spendable balance of a contract (in mutez), also known as liquid balance. Corresponds to tez owned by the contract that are neither -- GitLab