@@ -2312,6 +2312,28 @@ let test_genesis_creation =
2312
2312
Cli_lib.Exceptions. handle_nicely
2313
2313
Test_genesis_creation. time_genesis_creation )
2314
2314
2315
+ let test_generate_hardfork_config =
2316
+ let open Command.Param in
2317
+ let hardfork_config_dir_flag =
2318
+ flag " --hardfork-config-dir"
2319
+ ~doc: " DIR Directory to generate hardfork configuration" (required string )
2320
+ in
2321
+ Command. async ~summary: " Generate reference hardfork configuration"
2322
+ (Cli_lib.Background_daemon. rpc_init hardfork_config_dir_flag
2323
+ ~f: (fun port directory_name ->
2324
+ match % bind
2325
+ Daemon_rpcs.Client. dispatch_join_errors
2326
+ Daemon_rpcs.Generate_hardfork_config. rpc directory_name port
2327
+ with
2328
+ | Error e ->
2329
+ eprintf " Failed to request hardfork config generation: %s\n "
2330
+ (Error. to_string_hum e) ;
2331
+ exit 17
2332
+ | Ok () ->
2333
+ printf " Hardfork configuration successfully requested in %s\n "
2334
+ directory_name ;
2335
+ exit 0 ) )
2336
+
2315
2337
let test_ledger_application =
2316
2338
Command. async ~summary: " Test ledger application"
2317
2339
(let % map_open.Command privkey_path = Cli_lib.Flag. privkey_read_path
@@ -2535,7 +2557,9 @@ let advanced ~itn_features =
2535
2557
; (" print-signature-kind" , signature_kind)
2536
2558
; ( " test"
2537
2559
, Command. group ~summary: " Testing-only commands"
2538
- [ (" create-genesis" , test_genesis_creation) ] )
2560
+ [ (" create-genesis" , test_genesis_creation)
2561
+ ; (" generate-hardfork-config" , test_generate_hardfork_config)
2562
+ ] )
2539
2563
]
2540
2564
in
2541
2565
let cmds =
0 commit comments