Skip to content

Commit ce24e6d

Browse files
committed
do not deduplicate precomputed blocks after untarring
1 parent fc1a543 commit ce24e6d

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

src/test/mina_automation/network_data.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ let untar_precomputed_blocks t output =
5151
let precomputed_blocks_zip = precomputed_blocks_zip t in
5252
let%bind _ = Utils.untar ~archive:precomputed_blocks_zip ~output in
5353
let%bind array = Sys.readdir output in
54-
Deferred.return (Array.to_list array |> Utils.dedup_and_sort_archive_files)
54+
Deferred.return (Array.to_list array |> Utils.sort_archive_files)

src/test/mina_automation/utils.ml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,21 @@ let sed ~search ~replacement ~input =
1111
let untar ~archive ~output =
1212
Util.run_cmd_exn "." "tar" [ "-xf"; archive; "-C"; output ]
1313

14+
let precomputed_blocks_comparator left right =
15+
let scan_height name = Scanf.sscanf name "%_s@-%d-%_s" Fn.id in
16+
let left_height = scan_height left in
17+
let right_height = scan_height right in
18+
Int.compare left_height right_height
19+
20+
let sort_archive_files files : string list =
21+
files
22+
|> List.sort ~compare:(fun left right ->
23+
precomputed_blocks_comparator left right )
24+
1425
let dedup_and_sort_archive_files files : string list =
1526
files
1627
|> List.dedup_and_sort ~compare:(fun left right ->
17-
let scan_height name = Scanf.sscanf name "%_s@-%d-%_s" Fn.id in
18-
19-
let left_height = scan_height left in
20-
let right_height = scan_height right in
21-
22-
Int.compare left_height right_height )
28+
precomputed_blocks_comparator left right )
2329

2430
let force_kill process =
2531
Process.send_signal process Core.Signal.kill ;

0 commit comments

Comments
 (0)