aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/Merkle.ml
diff options
context:
space:
mode:
authorEstevan Castilho <tevo@riajuu.net>2026-08-23 03:35:01 +0000
committerEstevan Castilho <tevo@riajuu.net>2026-08-23 03:35:01 +0000
commit1d0b73b051cff4b14919808c51acbdd1c3e11767 (patch)
tree05da0359e9a12cc22c8fac20bd58625c1a1f8f43 /lib/kernel/Merkle.ml
parentc452541e935295f2708271a12207f7c7ee2636bf (diff)
downloadRNT-1d0b73b051cff4b14919808c51acbdd1c3e11767.tar.gz
RNT-1d0b73b051cff4b14919808c51acbdd1c3e11767.zip
Register the branch manager as part of the object tree
Diffstat (limited to 'lib/kernel/Merkle.ml')
-rw-r--r--lib/kernel/Merkle.ml4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/kernel/Merkle.ml b/lib/kernel/Merkle.ml
index ababb03..6172e6f 100644
--- a/lib/kernel/Merkle.ml
+++ b/lib/kernel/Merkle.ml
@@ -30,6 +30,7 @@ module type TREE = functor (S : Abstract.Storage.STORAGE) (K : KEY) -> sig
val lookup : S.transaction -> K.t -> node -> (address option, Concepts.Condition.condition) result
val fold_left : S.transaction -> ('c -> K.t -> address -> 'c) -> 'c -> node -> ('c, Concepts.Condition.condition) result
+ val keys : S.transaction -> node -> (K.t BatFingerTree.t, Concepts.Condition.condition) result
end
module Make : TREE = functor (S : Abstract.Storage.STORAGE) (K : KEY) -> struct
@@ -120,7 +121,7 @@ module Make : TREE = functor (S : Abstract.Storage.STORAGE) (K : KEY) -> struct
be used for intermediates and the like. *)
let hash_of node = to_blob node |> Concepts.Hash.hash_of_blob
- let find tx addr =
+ let find tx node =
let open Utilities.Result in
let* data = S.get tx (S.Hash node) in
match data with
@@ -303,6 +304,7 @@ module Make : TREE = functor (S : Abstract.Storage.STORAGE) (K : KEY) -> struct
fold_left tx f acc node)
(Ok acc) children
+ let keys tx node = fold_left tx (fun acc k _ -> BatFingerTree.snoc acc k) BatFingerTree.empty node
end
module type INTERFACE = functor (S : Abstract.Storage.STORAGE) (K : KEY) (V : VALUE) -> sig