aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel
diff options
context:
space:
mode:
authorEstevan Castilho <tevo@riajuu.net>2026-08-13 00:26:10 +0000
committerEstevan Castilho <tevo@riajuu.net>2026-08-23 03:06:55 +0000
commitf885a8f7dd85d79c5c8aa93265f5dea781b345a9 (patch)
tree2fc4c72e0436a278dc01d0387f38d1e0080d8284 /lib/kernel
parenta727eb4351df972ff2e34fa111aeb435e70cdbd4 (diff)
downloadRNT-f885a8f7dd85d79c5c8aa93265f5dea781b345a9.tar.gz
RNT-f885a8f7dd85d79c5c8aa93265f5dea781b345a9.zip
Avoid exporting `persist`
Diffstat (limited to '')
-rw-r--r--lib/kernel/BranchIndex.ml2
-rw-r--r--lib/kernel/BranchIndex.mli2
-rw-r--r--lib/kernel/Initialization.ml2
-rw-r--r--lib/kernel/Merkle.ml5
4 files changed, 6 insertions, 5 deletions
diff --git a/lib/kernel/BranchIndex.ml b/lib/kernel/BranchIndex.ml
index d1efa9a..00bd44d 100644
--- a/lib/kernel/BranchIndex.ml
+++ b/lib/kernel/BranchIndex.ml
@@ -21,8 +21,8 @@ module Make (Store : Abstract.Storage.STORAGE) = struct
type tree = Tree.node
let empty = Tree.empty
+ let empty_under = Tree.empty_under
let hash_of = Tree.hash_of
- let persist = Tree.persist
let find = Tree.find
let find_branch = Tree.lookup
let put_branch = Tree.insert
diff --git a/lib/kernel/BranchIndex.mli b/lib/kernel/BranchIndex.mli
index 5a867bf..ec7bfc7 100644
--- a/lib/kernel/BranchIndex.mli
+++ b/lib/kernel/BranchIndex.mli
@@ -9,8 +9,8 @@ module Make (Store : Abstract.Storage.STORAGE) : sig
type tree
val empty : tree
+ val empty_under : Store.transaction -> (address, Concepts.Condition.condition) result
val hash_of : tree -> root
- val persist : Store.transaction -> tree -> (root, Concepts.Condition.condition) result
val find : Store.transaction -> root -> (tree option, Concepts.Condition.condition) result
val find_branch :
diff --git a/lib/kernel/Initialization.ml b/lib/kernel/Initialization.ml
index d84a29e..a27539f 100644
--- a/lib/kernel/Initialization.ml
+++ b/lib/kernel/Initialization.ml
@@ -52,7 +52,7 @@ module Make (Store : Abstract.Storage.STORAGE) = struct
(* The first branch state has no synthetic "genesis" commit. Both [current]
and [history] point at persisted empty trees; the runtime mounts /system
around those roots after initialization. *)
- let* empty_root = Branch_index.persist tx Branch_index.empty in
+ let* empty_root = Branch_index.empty_under tx in
Concepts.BranchState.make ~current:empty_root ~history:empty_root ~tip:None
|> Concepts.BranchState.to_blob
|> S.store_blob tx
diff --git a/lib/kernel/Merkle.ml b/lib/kernel/Merkle.ml
index 5bd427f..6f342cd 100644
--- a/lib/kernel/Merkle.ml
+++ b/lib/kernel/Merkle.ml
@@ -19,11 +19,10 @@ module type TREE = functor (S : Abstract.Storage.STORAGE) (K : KEY) -> sig
val find : S.transaction -> address -> (node option, Concepts.Condition.condition) result
val empty : node
+ val empty_under : S.transaction -> (address, Concepts.Condition.condition) result
val hash_of : node -> address
- val persist : S.transaction -> node -> (address, Concepts.Condition.condition) result
-
val insert : S.transaction -> K.t -> address -> node -> (node, Concepts.Condition.condition) result
val remove : S.transaction -> K.t -> node -> (node, Concepts.Condition.condition) result
val lookup : S.transaction -> K.t -> node -> (address option, Concepts.Condition.condition) result
@@ -150,6 +149,8 @@ module Make : TREE = functor (S : Abstract.Storage.STORAGE) (K : KEY) -> struct
let* () = S.put tx addr data in
Ok addr
+ let empty_under tx = persist tx empty
+
type op = Update of address * node | Split of address * K.t * address
let emplace i v ft =