From d512411992a6a2b50fcdf03689129f70f530116f Mon Sep 17 00:00:00 2001 From: Marcos Magueta Date: Sat, 1 Aug 2026 14:22:05 -0300 Subject: Initialization with Branch State and Index --- lib/kernel/BranchIndex.mli | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 lib/kernel/BranchIndex.mli (limited to 'lib/kernel/BranchIndex.mli') diff --git a/lib/kernel/BranchIndex.mli b/lib/kernel/BranchIndex.mli new file mode 100644 index 0000000..5a867bf --- /dev/null +++ b/lib/kernel/BranchIndex.mli @@ -0,0 +1,28 @@ +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 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 : + 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 -- cgit v1.2.3