aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/Merkle.ml
diff options
context:
space:
mode:
authorEstevan Castilho <tevo@riajuu.net>2026-08-15 00:09:22 +0000
committerEstevan Castilho <tevo@riajuu.net>2026-08-23 03:06:56 +0000
commit5a4f7d5ed6e5d6b2711db316e8de06cea78b54ec (patch)
tree5a6372324f12858775848e169eace7be52a86101 /lib/kernel/Merkle.ml
parent403f1a62f66c33a7d39c17704f34debe579c89b0 (diff)
downloadRNT-5a4f7d5ed6e5d6b2711db316e8de06cea78b54ec.tar.gz
RNT-5a4f7d5ed6e5d6b2711db316e8de06cea78b54ec.zip
Allow storage backend addresses to be labels rather than hashes
Diffstat (limited to 'lib/kernel/Merkle.ml')
-rw-r--r--lib/kernel/Merkle.ml10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/kernel/Merkle.ml b/lib/kernel/Merkle.ml
index 49f4fda..60a10a7 100644
--- a/lib/kernel/Merkle.ml
+++ b/lib/kernel/Merkle.ml
@@ -118,7 +118,7 @@ module Make : TREE = functor (S : Abstract.Storage.STORAGE) (K : KEY) -> struct
let find tx node =
let open Utilities.Result in
- let* data = S.get tx node in
+ let* data = S.get tx (S.Hash node) in
match data with
| None -> Ok None
| Some data ->
@@ -146,7 +146,7 @@ module Make : TREE = functor (S : Abstract.Storage.STORAGE) (K : KEY) -> struct
let open Utilities.Result in
let data = to_blob node in
let addr = Concepts.Hash.hash_of_blob data in
- let* () = S.put tx addr data in
+ let* () = S.put tx (S.Hash addr) data in
Ok addr
let empty_under tx = persist tx empty
@@ -286,7 +286,7 @@ module Make : TREE = functor (S : Abstract.Storage.STORAGE) (K : KEY) -> struct
end
module type INTERFACE = functor (S : Abstract.Storage.STORAGE) (K : KEY) (V : VALUE) -> sig
- type address
+ type address = Concepts.Hash.hash
type node
val find : S.transaction -> address -> (node option, Concepts.Condition.condition) result
@@ -311,11 +311,11 @@ module Interface : INTERFACE = functor (S : Abstract.Storage.STORAGE) (K : KEY)
let intern tx v =
let data = V.encode v in
let addr = Concepts.Hash.hash_of_blob data in
- let* () = S.put tx addr data in
+ let* () = S.put tx (S.Hash addr) data in
Ok addr
let retrieve tx addr =
- let* data = S.get tx addr in
+ let* data = S.get tx (S.Hash addr) in
match data with
| None -> Ok None
| Some data ->