File tree Expand file tree Collapse file tree 4 files changed +12
-2
lines changed
Expand file tree Collapse file tree 4 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -461,7 +461,7 @@ module Make_str (A : Wire_types.Concrete) = struct
461461 let create_epoch_ledger ~config ~context :(module Context : CONTEXT )
462462 ~genesis_epoch_ledger =
463463 let open Context in
464- if Mina_ledger.Ledger.Root.Config. exists_backing config then (
464+ if Mina_ledger.Ledger.Root.Config. exists_any_backing config then (
465465 [% log info]
466466 ~metadata:
467467 [ (" config" , Mina_ledger.Ledger.Root.Config. to_yojson config) ]
Original file line number Diff line number Diff 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 ->
Original file line number Diff line number Diff 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 *)
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ module Root_test = struct
115115 in
116116 L.Root.Config. move_backing_exn ~src: config ~dst: config_moved ;
117117 assert (
118- (not (L.Root.Config. exists_backing config))
118+ (not (L.Root.Config. exists_any_backing config))
119119 && L.Root.Config. exists_backing config_moved
120120 || failwith " Config is not moved" ) ;
121121 let root_moved =
You can’t perform that action at this time.
0 commit comments