From 58ec189b676224ce422633f6635675de437d20e8 Mon Sep 17 00:00:00 2001 From: Valentin Chaboche Date: Tue, 17 Jan 2023 18:44:48 +0100 Subject: [PATCH 1/2] Scoru,Tezt: add interface file to detect dead code --- tezt/tests/sc_rollup.ml | 4 ++-- tezt/tests/sc_rollup.mli | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 tezt/tests/sc_rollup.mli diff --git a/tezt/tests/sc_rollup.ml b/tezt/tests/sc_rollup.ml index dabebc89791b..db2edc8ed069 100644 --- a/tezt/tests/sc_rollup.ml +++ b/tezt/tests/sc_rollup.ml @@ -1,7 +1,7 @@ (*****************************************************************************) (* *) (* Open Source License *) -(* Copyright (c) 2021-2022 Nomadic Labs *) +(* Copyright (c) 2021-2023 Nomadic Labs *) (* Copyright (c) 2022-2023 TriliTech *) (* *) (* Permission is hereby granted, free of charge, to any person obtaining a *) @@ -26,7 +26,7 @@ (* Testing ------- - Component: Smart Contract Optimistic Rollups + Component: Smart Optimistic Rollups Invocation: dune exec tezt/tests/main.exe -- --file sc_rollup.ml *) diff --git a/tezt/tests/sc_rollup.mli b/tezt/tests/sc_rollup.mli new file mode 100644 index 000000000000..114bf8e2355c --- /dev/null +++ b/tezt/tests/sc_rollup.mli @@ -0,0 +1,33 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021-2023 Nomadic Labs *) +(* Copyright (c) 2022-2023 TriliTech *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* Testing + ------- + Component: Smart Optimistic Rollups + Invocation: dune exec tezt/tests/main.exe -- --file sc_rollup.ml +*) + +val register : protocols:Protocol.t list -> unit -- GitLab From e9f5c31c4c4525c2ebb3602a4e681608098e3d06 Mon Sep 17 00:00:00 2001 From: Valentin Chaboche Date: Tue, 17 Jan 2023 18:45:55 +0100 Subject: [PATCH 2/2] Scoru,Tezt: remove unused helper --- tezt/tests/sc_rollup.ml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/tezt/tests/sc_rollup.ml b/tezt/tests/sc_rollup.ml index db2edc8ed069..3c78c4dc93f3 100644 --- a/tezt/tests/sc_rollup.ml +++ b/tezt/tests/sc_rollup.ml @@ -699,21 +699,6 @@ let get_inbox_from_sc_rollup_node sc_rollup_node = let* inbox = sc_rollup_node_rpc sc_rollup_node "global/block/head/inbox" in parse_inbox inbox -let fetch_messages_from_block client = - let* ops = RPC.Client.call client @@ RPC.get_chain_block_operations () in - let messages = - ops |> JSON.as_list - |> List.concat_map JSON.as_list - |> List.concat_map (fun op -> JSON.(op |-> "contents" |> as_list)) - |> List.filter_map (fun op -> - if JSON.(op |-> "kind" |> as_string) = "smart_rollup_add_messages" - then Some JSON.(op |-> "message" |> as_list) - else None) - |> List.hd - |> List.map (fun message -> JSON.(message |> as_string)) - in - return messages - (* Synchronizing the inbox in the rollup node ------------------------------------------ -- GitLab