From 295e9caae85bfaa9b7baefed1c45dca01f4685b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Proust?= Date: Wed, 5 Oct 2022 08:32:22 +0100 Subject: [PATCH 1/4] Proto-env: add blanket fine-grained error handling to lazy-encoding --- .../environment_V5.ml | 2 +- .../environment_V6.ml | 2 +- .../environment_V7.ml | 2 +- .../environment_V8.ml | 2 +- .../tezos_protocol_environment_structs.ml | 3 + .../structs/v0_data_encoding.ml | 52 +++++++++++++ .../structs/v3_data_encoding.ml | 52 +++++++++++++ .../structs/v5_data_encoding.ml | 78 +++++++++++++++++++ 8 files changed, 189 insertions(+), 4 deletions(-) create mode 100644 src/lib_protocol_environment/structs/v5_data_encoding.ml diff --git a/src/lib_protocol_environment/environment_V5.ml b/src/lib_protocol_environment/environment_V5.ml index 9425e50a5fa7..e8b289daaf72 100644 --- a/src/lib_protocol_environment/environment_V5.ml +++ b/src/lib_protocol_environment/environment_V5.ml @@ -241,7 +241,7 @@ struct module Lwt = Lwt module Data_encoding = struct - include Data_encoding + include Tezos_protocol_environment_structs.V5.Data_encoding type tag_size = [`Uint8 | `Uint16] diff --git a/src/lib_protocol_environment/environment_V6.ml b/src/lib_protocol_environment/environment_V6.ml index 35cc9e792c29..8418e886045c 100644 --- a/src/lib_protocol_environment/environment_V6.ml +++ b/src/lib_protocol_environment/environment_V6.ml @@ -247,7 +247,7 @@ struct module Lwt = Lwt module Data_encoding = struct - include Data_encoding + include Tezos_protocol_environment_structs.V6.Data_encoding type tag_size = [`Uint8 | `Uint16] diff --git a/src/lib_protocol_environment/environment_V7.ml b/src/lib_protocol_environment/environment_V7.ml index 888cb15cadf8..77607a11bea7 100644 --- a/src/lib_protocol_environment/environment_V7.ml +++ b/src/lib_protocol_environment/environment_V7.ml @@ -256,7 +256,7 @@ struct module Lwt = Lwt module Data_encoding = struct - include Data_encoding + include Tezos_protocol_environment_structs.V7.Data_encoding type tag_size = [`Uint8 | `Uint16] diff --git a/src/lib_protocol_environment/environment_V8.ml b/src/lib_protocol_environment/environment_V8.ml index 6a6b32df82d2..0588c8f171a2 100644 --- a/src/lib_protocol_environment/environment_V8.ml +++ b/src/lib_protocol_environment/environment_V8.ml @@ -261,7 +261,7 @@ struct module Lwt = Lwt module Data_encoding = struct - include Data_encoding + include Tezos_protocol_environment_structs.V8.Data_encoding type tag_size = [`Uint8 | `Uint16] diff --git a/src/lib_protocol_environment/structs/tezos_protocol_environment_structs.ml b/src/lib_protocol_environment/structs/tezos_protocol_environment_structs.ml index 42dab242a816..b3fb8569fbc5 100644 --- a/src/lib_protocol_environment/structs/tezos_protocol_environment_structs.ml +++ b/src/lib_protocol_environment/structs/tezos_protocol_environment_structs.ml @@ -91,12 +91,14 @@ module V4 = struct end module V5 = struct + module Data_encoding = V5_data_encoding module Error_monad_infix_globals = V0_error_monad_infix_globals module Bounded = V5_bounded module RPC_directory = V0_RPC_directory end module V6 = struct + module Data_encoding = V5_data_encoding module Error_monad_infix_globals = V0_error_monad_infix_globals module Plonk = V6_plonk module Bounded = V5_bounded @@ -104,6 +106,7 @@ module V6 = struct end module V7 = struct + module Data_encoding = V5_data_encoding module Error_monad_infix_globals = V0_error_monad_infix_globals module Array = V7_array module Plonk = V7_plonk diff --git a/src/lib_protocol_environment/structs/v0_data_encoding.ml b/src/lib_protocol_environment/structs/v0_data_encoding.ml index add46e3eb570..7408db2bd2ed 100644 --- a/src/lib_protocol_environment/structs/v0_data_encoding.ml +++ b/src/lib_protocol_environment/structs/v0_data_encoding.ml @@ -25,6 +25,58 @@ include Data_encoding +module Encoding = struct + include Encoding + + let lazy_encoding encoding = + let binary = lazy_encoding encoding in + let json = + let open Json_encoding in + let write (type value) + (module Repr : Json_repr.Repr with type value = value) le = + match force_decode le with + | Some r -> + Json_repr.convert + (module Json_repr.Ezjsonm) + (module Repr) + (Json.construct encoding r) + | None -> Repr.repr (`O [("unparsed-binary", Repr.repr `Null)]) + in + let read (type value) + (module Repr : Json_repr.Repr with type value = value) j = + let j = Json_repr.convert (module Repr) (module Json_repr.Ezjsonm) j in + make_lazy encoding (Json.destruct encoding j) + in + repr_agnostic_custom {write; read} ~schema:Json_schema.any + in + Data_encoding__Encoding.raw_splitted ~json ~binary +end + +(* We have to define this twice bc in data-encoding<0.7 the type equality for + [lazy_t] is not propagated. *) +let lazy_encoding encoding = + let binary = lazy_encoding encoding in + let json = + let open Json_encoding in + let write (type value) + (module Repr : Json_repr.Repr with type value = value) le = + match force_decode le with + | Some r -> + Json_repr.convert + (module Json_repr.Ezjsonm) + (module Repr) + (Json.construct encoding r) + | None -> Repr.repr (`O [("unparsed-binary", Repr.repr `Null)]) + in + let read (type value) (module Repr : Json_repr.Repr with type value = value) + j = + let j = Json_repr.convert (module Repr) (module Json_repr.Ezjsonm) j in + make_lazy encoding (Json.destruct encoding j) + in + repr_agnostic_custom {write; read} ~schema:Json_schema.any + in + Data_encoding__Encoding.raw_splitted ~json ~binary + module Json = struct include Data_encoding.Json diff --git a/src/lib_protocol_environment/structs/v3_data_encoding.ml b/src/lib_protocol_environment/structs/v3_data_encoding.ml index 9f35ff48880c..dad106acbd63 100644 --- a/src/lib_protocol_environment/structs/v3_data_encoding.ml +++ b/src/lib_protocol_environment/structs/v3_data_encoding.ml @@ -25,6 +25,58 @@ include Data_encoding +module Encoding = struct + include Encoding + + let lazy_encoding encoding = + let binary = lazy_encoding encoding in + let json = + let open Json_encoding in + let write (type value) + (module Repr : Json_repr.Repr with type value = value) le = + match force_decode le with + | Some r -> + Json_repr.convert + (module Json_repr.Ezjsonm) + (module Repr) + (Json.construct encoding r) + | None -> Repr.repr (`O [("unparsed-binary", Repr.repr `Null)]) + in + let read (type value) + (module Repr : Json_repr.Repr with type value = value) j = + let j = Json_repr.convert (module Repr) (module Json_repr.Ezjsonm) j in + make_lazy encoding (Json.destruct encoding j) + in + repr_agnostic_custom {write; read} ~schema:Json_schema.any + in + Data_encoding__Encoding.raw_splitted ~json ~binary +end + +(* We have to define this twice bc in data-encoding<0.7 the type equality for + [lazy_t] is not propagated. *) +let lazy_encoding encoding = + let binary = lazy_encoding encoding in + let json = + let open Json_encoding in + let write (type value) + (module Repr : Json_repr.Repr with type value = value) le = + match force_decode le with + | Some r -> + Json_repr.convert + (module Json_repr.Ezjsonm) + (module Repr) + (Json.construct encoding r) + | None -> Repr.repr (`O [("unparsed-binary", Repr.repr `Null)]) + in + let read (type value) (module Repr : Json_repr.Repr with type value = value) + j = + let j = Json_repr.convert (module Repr) (module Json_repr.Ezjsonm) j in + make_lazy encoding (Json.destruct encoding j) + in + repr_agnostic_custom {write; read} ~schema:Json_schema.any + in + Data_encoding__Encoding.raw_splitted ~json ~binary + module Json = struct include Data_encoding.Json diff --git a/src/lib_protocol_environment/structs/v5_data_encoding.ml b/src/lib_protocol_environment/structs/v5_data_encoding.ml new file mode 100644 index 000000000000..06e8efe57475 --- /dev/null +++ b/src/lib_protocol_environment/structs/v5_data_encoding.ml @@ -0,0 +1,78 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs. *) +(* *) +(* 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. *) +(* *) +(*****************************************************************************) + +include Data_encoding + +module Encoding = struct + include Encoding + + let lazy_encoding encoding = + let binary = lazy_encoding encoding in + let json = + let open Json_encoding in + let write (type value) + (module Repr : Json_repr.Repr with type value = value) le = + match force_decode le with + | Some r -> + Json_repr.convert + (module Json_repr.Ezjsonm) + (module Repr) + (Json.construct encoding r) + | None -> Repr.repr (`O [("unparsed-binary", Repr.repr `Null)]) + in + let read (type value) + (module Repr : Json_repr.Repr with type value = value) j = + let j = Json_repr.convert (module Repr) (module Json_repr.Ezjsonm) j in + make_lazy encoding (Json.destruct encoding j) + in + repr_agnostic_custom {write; read} ~schema:Json_schema.any + in + Data_encoding__Encoding.raw_splitted ~json ~binary +end + +(* We have to define this twice bc in data-encoding<0.7 the type equality for + [lazy_t] is not propagated. *) +let lazy_encoding encoding = + let binary = lazy_encoding encoding in + let json = + let open Json_encoding in + let write (type value) + (module Repr : Json_repr.Repr with type value = value) le = + match force_decode le with + | Some r -> + Json_repr.convert + (module Json_repr.Ezjsonm) + (module Repr) + (Json.construct encoding r) + | None -> Repr.repr (`O [("unparsed-binary", Repr.repr `Null)]) + in + let read (type value) (module Repr : Json_repr.Repr with type value = value) + j = + let j = Json_repr.convert (module Repr) (module Json_repr.Ezjsonm) j in + make_lazy encoding (Json.destruct encoding j) + in + repr_agnostic_custom {write; read} ~schema:Json_schema.any + in + Data_encoding__Encoding.raw_splitted ~json ~binary -- GitLab From c2dccd9a3b89432058f4a9da3652a0eded5d2e5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Proust?= Date: Wed, 5 Oct 2022 09:09:56 +0100 Subject: [PATCH 2/4] Proto-env: exfiltrate invalid lazy bytes to JSON --- .../structs/v0_data_encoding.ml | 18 ++++++++++++++++-- .../structs/v3_data_encoding.ml | 18 ++++++++++++++++-- .../structs/v5_data_encoding.ml | 18 ++++++++++++++++-- 3 files changed, 48 insertions(+), 6 deletions(-) diff --git a/src/lib_protocol_environment/structs/v0_data_encoding.ml b/src/lib_protocol_environment/structs/v0_data_encoding.ml index 7408db2bd2ed..1988704c5d60 100644 --- a/src/lib_protocol_environment/structs/v0_data_encoding.ml +++ b/src/lib_protocol_environment/structs/v0_data_encoding.ml @@ -40,7 +40,14 @@ module Encoding = struct (module Json_repr.Ezjsonm) (module Repr) (Json.construct encoding r) - | None -> Repr.repr (`O [("unparsed-binary", Repr.repr `Null)]) + | None -> + apply_lazy + ~fun_value:(fun _ -> assert false) + ~fun_bytes:(fun b -> + let (`Hex h) = Hex.of_bytes b in + Repr.repr (`O [("unparsed-binary", Repr.repr (`String h))])) + ~fun_combine:(fun _ _ -> assert false) + le in let read (type value) (module Repr : Json_repr.Repr with type value = value) j = @@ -66,7 +73,14 @@ let lazy_encoding encoding = (module Json_repr.Ezjsonm) (module Repr) (Json.construct encoding r) - | None -> Repr.repr (`O [("unparsed-binary", Repr.repr `Null)]) + | None -> + apply_lazy + ~fun_value:(fun _ -> assert false) + ~fun_bytes:(fun b -> + let (`Hex h) = Hex.of_bytes b in + Repr.repr (`O [("unparsed-binary", Repr.repr (`String h))])) + ~fun_combine:(fun _ _ -> assert false) + le in let read (type value) (module Repr : Json_repr.Repr with type value = value) j = diff --git a/src/lib_protocol_environment/structs/v3_data_encoding.ml b/src/lib_protocol_environment/structs/v3_data_encoding.ml index dad106acbd63..7b19599ddbca 100644 --- a/src/lib_protocol_environment/structs/v3_data_encoding.ml +++ b/src/lib_protocol_environment/structs/v3_data_encoding.ml @@ -40,7 +40,14 @@ module Encoding = struct (module Json_repr.Ezjsonm) (module Repr) (Json.construct encoding r) - | None -> Repr.repr (`O [("unparsed-binary", Repr.repr `Null)]) + | None -> + apply_lazy + ~fun_value:(fun _ -> assert false) + ~fun_bytes:(fun b -> + let (`Hex h) = Hex.of_bytes b in + Repr.repr (`O [("unparsed-binary", Repr.repr (`String h))])) + ~fun_combine:(fun _ _ -> assert false) + le in let read (type value) (module Repr : Json_repr.Repr with type value = value) j = @@ -66,7 +73,14 @@ let lazy_encoding encoding = (module Json_repr.Ezjsonm) (module Repr) (Json.construct encoding r) - | None -> Repr.repr (`O [("unparsed-binary", Repr.repr `Null)]) + | None -> + apply_lazy + ~fun_value:(fun _ -> assert false) + ~fun_bytes:(fun b -> + let (`Hex h) = Hex.of_bytes b in + Repr.repr (`O [("unparsed-binary", Repr.repr (`String h))])) + ~fun_combine:(fun _ _ -> assert false) + le in let read (type value) (module Repr : Json_repr.Repr with type value = value) j = diff --git a/src/lib_protocol_environment/structs/v5_data_encoding.ml b/src/lib_protocol_environment/structs/v5_data_encoding.ml index 06e8efe57475..0dc7fdcb656e 100644 --- a/src/lib_protocol_environment/structs/v5_data_encoding.ml +++ b/src/lib_protocol_environment/structs/v5_data_encoding.ml @@ -40,7 +40,14 @@ module Encoding = struct (module Json_repr.Ezjsonm) (module Repr) (Json.construct encoding r) - | None -> Repr.repr (`O [("unparsed-binary", Repr.repr `Null)]) + | None -> + apply_lazy + ~fun_value:(fun _ -> assert false) + ~fun_bytes:(fun b -> + let (`Hex h) = Hex.of_bytes b in + Repr.repr (`O [("unparsed-binary", Repr.repr (`String h))])) + ~fun_combine:(fun _ _ -> assert false) + le in let read (type value) (module Repr : Json_repr.Repr with type value = value) j = @@ -66,7 +73,14 @@ let lazy_encoding encoding = (module Json_repr.Ezjsonm) (module Repr) (Json.construct encoding r) - | None -> Repr.repr (`O [("unparsed-binary", Repr.repr `Null)]) + | None -> + apply_lazy + ~fun_value:(fun _ -> assert false) + ~fun_bytes:(fun b -> + let (`Hex h) = Hex.of_bytes b in + Repr.repr (`O [("unparsed-binary", Repr.repr (`String h))])) + ~fun_combine:(fun _ _ -> assert false) + le in let read (type value) (module Repr : Json_repr.Repr with type value = value) j = -- GitLab From cc3b7742168227044a7f18fa5b76ddc7d2d9fe73 Mon Sep 17 00:00:00 2001 From: Diane Gallois-Wong Date: Wed, 5 Oct 2022 16:47:57 +0200 Subject: [PATCH 3/4] Proto-env/test: add a test on an unparsable lazy expr --- src/lib_protocol_environment/test/test.ml | 12 ++- .../test/test_data_encoding.ml | 76 +++++++++++++++++++ 2 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 src/lib_protocol_environment/test/test_data_encoding.ml diff --git a/src/lib_protocol_environment/test/test.ml b/src/lib_protocol_environment/test/test.ml index f121a0846057..0af3b0a88b9c 100644 --- a/src/lib_protocol_environment/test/test.ml +++ b/src/lib_protocol_environment/test/test.ml @@ -23,8 +23,18 @@ (* *) (*****************************************************************************) +(* Invocation: + dune exec src/lib_protocol_environment/test/test.exe + or for a superset of these tests: + dune build @src/lib_protocol_environment/runtest +*) + let () = Alcotest_lwt.run "tezos-shell-context" - [("mem_context", Test_mem_context.tests); ("cache", Test_cache.tests)] + [ + ("mem_context", Test_mem_context.tests); + ("cache", Test_cache.tests); + ("data_encoding", Test_data_encoding.tests); + ] |> Lwt_main.run diff --git a/src/lib_protocol_environment/test/test_data_encoding.ml b/src/lib_protocol_environment/test/test_data_encoding.ml new file mode 100644 index 000000000000..6ece1c48ad8e --- /dev/null +++ b/src/lib_protocol_environment/test/test_data_encoding.ml @@ -0,0 +1,76 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs *) +(* *) +(* 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: Environment structs + Invocation: dune exec src/lib_protocol_environment/test/test.exe -- test "^data_encoding$" + Subject: Environment structs modifications to Data_encoding + e.g. in src/lib_protocol_environment/structs/v5_data_encoding.ml +*) + +open Tezos_protocol_environment_structs.V8 + +type t = {x : int; y : string Data_encoding.lazy_t} + +let test_unparsable_lazyexpr () = + let parsed_encoding = Data_encoding.(lazy_encoding (Fixed.string 3)) in + let enc = + let open Data_encoding in + conv + (fun {x; y} -> (x, y)) + (fun (x, y) -> {x; y}) + (obj2 (req "x" int8) (req "y" parsed_encoding)) + in + let bytes_v = Hex.(to_bytes_exn (`Hex "030000000401020304")) in + let v = Data_encoding.Binary.of_bytes_exn enc bytes_v in + let json = + try Data_encoding.Json.construct enc v + with exn -> + Alcotest.failf + "Unexpected exception in %s:@\n%s" + __LOC__ + (Printexc.to_string exn) + in + let expected_json = + `O + [ + ("x", `Float 3.000000); + ("y", `O [("unparsed-binary", `String "01020304")]); + ] + in + Lib_test.Assert.equal + ~pp:Data_encoding.Json.pp + ~msg:"Constructed json is incorrect" + ~loc:__LOC__ + expected_json + json ; + Lwt.return_unit + +let tests = + [ + Alcotest_lwt.test_case "unparsable_lazyexpr" `Quick (fun _ -> + test_unparsable_lazyexpr); + ] -- GitLab From a04ed408b4388c2306438c3d2a5a5156c73201bc Mon Sep 17 00:00:00 2001 From: vbot Date: Wed, 5 Oct 2022 18:58:04 +0200 Subject: [PATCH 4/4] Proto-env/Tests: clean up tests --- manifest/main.ml | 2 +- src/lib_protocol_environment/test/dune | 7 +--- .../test/test_cache.ml | 2 +- .../test/test_cache.mli | 35 ------------------ .../test/test_mem_context.ml | 2 +- .../test/test_mem_context.mli | 36 ------------------- .../test/test_mem_context_array_theory.ml | 2 +- 7 files changed, 5 insertions(+), 81 deletions(-) delete mode 100644 src/lib_protocol_environment/test/test_cache.mli delete mode 100644 src/lib_protocol_environment/test/test_mem_context.mli diff --git a/manifest/main.ml b/manifest/main.ml index 1f53fbe8bcf6..0d5956dc7735 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -1931,7 +1931,7 @@ let octez_shell_context = let _octez_protocol_environment_tests = tests - ["test"; "test_mem_context_array_theory"; "test_cache"] + ["test"; "test_mem_context_array_theory"] ~path:"src/lib_protocol_environment/test" ~opam:"tezos-protocol-environment" ~deps: diff --git a/src/lib_protocol_environment/test/dune b/src/lib_protocol_environment/test/dune index c5123f6aeaa3..6e3bb3b09727 100644 --- a/src/lib_protocol_environment/test/dune +++ b/src/lib_protocol_environment/test/dune @@ -2,7 +2,7 @@ ; Edit file manifest/main.ml instead. (executables - (names test test_mem_context_array_theory test_cache) + (names test test_mem_context_array_theory) (libraries tezos-base tezos-base.unix @@ -25,8 +25,3 @@ (alias runtest) (package tezos-protocol-environment) (action (run %{dep:./test_mem_context_array_theory.exe}))) - -(rule - (alias runtest) - (package tezos-protocol-environment) - (action (run %{dep:./test_cache.exe}))) diff --git a/src/lib_protocol_environment/test/test_cache.ml b/src/lib_protocol_environment/test/test_cache.ml index 5b13c7ba5d0b..8bb936526ade 100644 --- a/src/lib_protocol_environment/test/test_cache.ml +++ b/src/lib_protocol_environment/test/test_cache.ml @@ -27,7 +27,7 @@ (** Testing ------- Component: Protocol Cache - Invocation: dune build @src/lib_protocol_environment/runtest + Invocation: dune exec src/lib_protocol_environment/test/test.exe -- test "^cache$" Dependencies: src/lib_protocol_environment/test/assert.ml Subject: Low-level operations on protocol cache *) diff --git a/src/lib_protocol_environment/test/test_cache.mli b/src/lib_protocol_environment/test/test_cache.mli deleted file mode 100644 index ed614e82efdd..000000000000 --- a/src/lib_protocol_environment/test/test_cache.mli +++ /dev/null @@ -1,35 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2021 Nomadic Labs *) -(* Copyright (c) 2021 Marigold *) -(* *) -(* 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: Protocol Cache - Invocation: dune build @src/lib_protocol_environment/runtest - Dependencies: src/lib_protocol_environment/test/assert.ml - Subject: Low-level operations on protocol cache -*) - -val tests : unit Alcotest_lwt.test_case trace diff --git a/src/lib_protocol_environment/test/test_mem_context.ml b/src/lib_protocol_environment/test/test_mem_context.ml index 49bc72320c45..3a5851539006 100644 --- a/src/lib_protocol_environment/test/test_mem_context.ml +++ b/src/lib_protocol_environment/test/test_mem_context.ml @@ -26,7 +26,7 @@ (** Testing ------- Component: Protocol Environment - Invocation: dune build @src/lib_protocol_environment/runtest + Invocation: dune exec src/lib_protocol_environment/test/test.exe -- test "^mem_context$" Dependencies: src/lib_protocol_environment/test/assert.ml Subject: Low-level operations on memory contexts. *) diff --git a/src/lib_protocol_environment/test/test_mem_context.mli b/src/lib_protocol_environment/test/test_mem_context.mli deleted file mode 100644 index 7604b41118b4..000000000000 --- a/src/lib_protocol_environment/test/test_mem_context.mli +++ /dev/null @@ -1,36 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. *) -(* *) -(* 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: Protocol Environment - Invocation: dune build @src/lib_protocol_environment/runtest - Dependencies: src/lib_protocol_environment/test/assert.ml - Subject: Low-level operations on memory contexts. -*) - -val tests : unit Alcotest_lwt.test_case trace - -val domain : Context.t -> string list list Lwt.t diff --git a/src/lib_protocol_environment/test/test_mem_context_array_theory.ml b/src/lib_protocol_environment/test/test_mem_context_array_theory.ml index 09e889497d96..a2afb1b3172e 100644 --- a/src/lib_protocol_environment/test/test_mem_context_array_theory.ml +++ b/src/lib_protocol_environment/test/test_mem_context_array_theory.ml @@ -26,7 +26,7 @@ (** Testing ------- Component: Protocol Environment - Invocation: dune build @src/lib_protocol_environment/runtest + Invocation: dune exec src/lib_protocol_environment/test/test_mem_context_array_theory.exe Dependencies: src/lib_protocol_environment/test/test_mem_context.ml Subject: get/set operations on memory contexts. *) -- GitLab