Skip to content

Commit 72bec04

Browse files
committed
Add exists_any_backing to root config
1 parent 9e0cb54 commit 72bec04

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/lib/mina_ledger/root.ml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ struct
8686
| Converting_db_config { primary_directory; converting_directory } ->
8787
file_exists primary_directory && file_exists converting_directory
8888

89+
let exists_any_backing = function
90+
| Stable_db_config path ->
91+
file_exists path
92+
| Converting_db_config { primary_directory; converting_directory = _ } ->
93+
file_exists primary_directory
94+
8995
let with_directory ~backing_type ~directory_name =
9096
match backing_type with
9197
| Stable_db ->

src/lib/mina_ledger/root.mli

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ module Make
9090
(** Test if a root ledger backing already exists with this config *)
9191
val exists_backing : t -> bool
9292

93+
(** Test if a root ledger backing already exists with this config, ignoring
94+
the specific backing type of the root *)
95+
val exists_any_backing : t -> bool
96+
9397
(** Delete a backing of any type that might exist with this config, if
9498
present. this function will try any backing type even if it didn't match
9599
up with one provided in the config *)

0 commit comments

Comments
 (0)