aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEstevan Castilho <tevo@riajuu.net>2026-08-13 02:35:57 +0000
committerEstevan Castilho <tevo@riajuu.net>2026-08-23 03:06:55 +0000
commit33653002e66f83ec10f4382dd4ad3c18dbf2abff (patch)
tree1bdd0ba172ee43f191052ff405ee03a9a892618a
parentafbab0968340abcec044d9ac70c4a3ec0756933e (diff)
downloadRNT-33653002e66f83ec10f4382dd4ad3c18dbf2abff.tar.gz
RNT-33653002e66f83ec10f4382dd4ad3c18dbf2abff.zip
Move StringKey out of the tests
-rw-r--r--lib/kernel/Merkle.ml8
-rw-r--r--test/unit/kernel/Merkle.ml10
2 files changed, 9 insertions, 9 deletions
diff --git a/lib/kernel/Merkle.ml b/lib/kernel/Merkle.ml
index 6f342cd..49f4fda 100644
--- a/lib/kernel/Merkle.ml
+++ b/lib/kernel/Merkle.ml
@@ -339,3 +339,11 @@ module Interface : INTERFACE = functor (S : Abstract.Storage.STORAGE) (K : KEY)
| Some addr -> retrieve tx addr
end
+
+module StringKey : KEY with type t = string = struct
+ type t = string
+
+ let encode s = String.to_bytes s |> Concepts.Representation.blob_of_bytes
+ let compare s1 s2 = String.compare s1 s2 |> Concepts.Ordering.of_int
+ let decode b = Concepts.Representation.bytes_of_blob b |> String.of_bytes |> Result.ok
+end
diff --git a/test/unit/kernel/Merkle.ml b/test/unit/kernel/Merkle.ml
index f12182a..6fd493a 100644
--- a/test/unit/kernel/Merkle.ml
+++ b/test/unit/kernel/Merkle.ml
@@ -1,18 +1,10 @@
open Rnt
-module StringKey : Rnt.Kernel.Merkle.KEY with type t = string = struct
- type t = string
-
- let encode s = String.to_bytes s |> Concepts.Representation.blob_of_bytes
- let compare s1 s2 = String.compare s1 s2 |> Concepts.Ordering.of_int
- let decode b = Concepts.Representation.bytes_of_blob b |> String.of_bytes |> Result.ok
-end
-
module Make (S : Abstract.Storage.STORAGE) (C : Helpers.Storage.CONFIGURATOR) = struct
open Alcotest
module H = Helpers.Storage.Make (S) (C)
- module T = Rnt.Kernel.Merkle.Interface (S) (StringKey) (StringKey)
+ module T = Rnt.Kernel.Merkle.Interface (S) (Rnt.Kernel.Merkle.StringKey) (Rnt.Kernel.Merkle.StringKey)
(* TODO: be a bit more comprehensive (ideally, we want to test splits as well) *)
let insert_and_lookup conn =