aboutsummaryrefslogtreecommitdiffstats
path: root/lib/manipulation.ml
diff options
context:
space:
mode:
authorMarcos Magueta <maguetamarcos@gmail.com>2026-05-18 12:35:26 -0300
committerGitHub <noreply@github.com>2026-05-18 12:35:26 -0300
commitcf0fffed43d0ca7618cd0013411151e057b7a32a (patch)
tree35915aee3f7160b9ff6b41c3c0502b34050f642c /lib/manipulation.ml
parente3d3e20dfea253de291d5b31059cd55c0eaabf02 (diff)
downloadSakura-cf0fffed43d0ca7618cd0013411151e057b7a32a.tar.gz
Sakura-cf0fffed43d0ca7618cd0013411151e057b7a32a.zip
RNT interface
Co-authored-by: Estevan Castilho <tevo@riajuu.net>
Diffstat (limited to 'lib/manipulation.ml')
-rw-r--r--lib/manipulation.ml12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/manipulation.ml b/lib/manipulation.ml
index dd09378..55b1c32 100644
--- a/lib/manipulation.ml
+++ b/lib/manipulation.ml
@@ -14,11 +14,11 @@
(** Functor to create manipulation operations with a storage backend *)
module Make (Storage : Management.Physical.S) = struct
- include Nt
-
type storage = Storage.t
type error = Error.t
-
+
+ let ( let* ) = Result.bind
+
(* State Persistence - Store relation and database states *)
(** Store a relation state to storage *)
@@ -30,11 +30,13 @@ module Make (Storage : Management.Physical.S) = struct
| Error _ -> Error (Error.StorageError "Failed to store relation")
| Ok () -> Ok ()
- (** Store a database state to storage *)
+ (** Store a database state to storage.
+ Keyed by [db#name]; content-hashing of mgs is no longer maintained on the
+ Sakura side — the kernel owns mg content addressing. *)
let store_multigroup (storage : storage) (db : Management.Multigroup.multigroup) :
(unit, error) Result.t =
match
- Storage.store_raw storage db#hash (Storable.Multigroup.to_bytes @@ db#serialize ())
+ Storage.store_raw storage db#name (Storable.Multigroup.to_bytes @@ db#serialize ())
with
| Error _ -> Error (Error.StorageError "Failed to store multigroup")
| Ok () -> Ok ()