diff options
| author | Estevan Castilho <tevo@riajuu.net> | 2026-08-20 00:00:36 +0000 |
|---|---|---|
| committer | Estevan Castilho <tevo@riajuu.net> | 2026-08-23 03:06:57 +0000 |
| commit | 465f3378daea5a6f0d44f3729c3551a9cda78ed9 (patch) | |
| tree | 0dd0e2a9bed53ef8132d8cfef41502a54cc5b97c /lib/kernel/BranchIndex.ml | |
| parent | 5a4f7d5ed6e5d6b2711db316e8de06cea78b54ec (diff) | |
| download | RNT-465f3378daea5a6f0d44f3729c3551a9cda78ed9.tar.gz RNT-465f3378daea5a6f0d44f3729c3551a9cda78ed9.zip | |
BranchManager sketch
Diffstat (limited to '')
| -rw-r--r-- | lib/kernel/BranchIndex.ml | 29 | ||||
| -rw-r--r-- | lib/kernel/BranchIndex.mli | 28 |
2 files changed, 0 insertions, 57 deletions
diff --git a/lib/kernel/BranchIndex.ml b/lib/kernel/BranchIndex.ml deleted file mode 100644 index 00bd44d..0000000 --- a/lib/kernel/BranchIndex.ml +++ /dev/null @@ -1,29 +0,0 @@ -type address = Concepts.Hash.hash -type root = address -type branch_name = string -type branch_state_root = address - -let default_branch_name = "master" - -module Branch_name = struct - type t = branch_name - - let encode name = Concepts.Codec.Bencode.(String name |> to_blob) - let compare left right = Concepts.Ordering.of_int (String.compare left right) - - let decode blob = - Concepts.Codec.Bencode.of_blob blob |> Utilities.Result.fmap Concepts.Codec.Bencode.as_string -end - -module Make (Store : Abstract.Storage.STORAGE) = struct - module Tree = Merkle.Make (Store) (Branch_name) - - type tree = Tree.node - - let empty = Tree.empty - let empty_under = Tree.empty_under - let hash_of = Tree.hash_of - let find = Tree.find - let find_branch = Tree.lookup - let put_branch = Tree.insert -end diff --git a/lib/kernel/BranchIndex.mli b/lib/kernel/BranchIndex.mli deleted file mode 100644 index ec7bfc7..0000000 --- a/lib/kernel/BranchIndex.mli +++ /dev/null @@ -1,28 +0,0 @@ -type address = Concepts.Hash.hash -type root = address -type branch_name = string -type branch_state_root = address - -val default_branch_name : branch_name - -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 find : Store.transaction -> root -> (tree option, Concepts.Condition.condition) result - - val find_branch : - Store.transaction -> - branch_name -> - tree -> - (branch_state_root option, Concepts.Condition.condition) result - - val put_branch : - Store.transaction -> - branch_name -> - branch_state_root -> - tree -> - (tree, Concepts.Condition.condition) result -end |
