Skip to content

Commit

Permalink
Make slot end compile params int instead of Global_slot.t
Browse files Browse the repository at this point in the history
  • Loading branch information
joaosreis committed Feb 2, 2024
1 parent 46a00e9 commit 4adc91f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/lib/mina_compile_config/dune
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(library
(name mina_compile_config)
(public_name mina_compile_config)
(libraries currency mina_numbers)
(libraries currency)
(preprocessor_deps ../../config.mlh)
(instrumentation (backend bisect_ppx))
(preprocess (pps ppx_version ppx_base ppx_optcomp)))
8 changes: 4 additions & 4 deletions src/lib/mina_compile_config/mina_compile_config.ml
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,24 @@ let rpc_heartbeat_send_every_sec = 10.0 (*same as the default*)

[%%ifndef slot_tx_end]

let slot_tx_end : Mina_numbers.Global_slot.t option = None
let slot_tx_end : int option = None

[%%else]

[%%inject "slot_tx_end", slot_tx_end]

let slot_tx_end = Some (Mina_numbers.Global_slot.of_int slot_tx_end)
let slot_tx_end = Some slot_tx_end

[%%endif]

[%%ifndef slot_chain_end]

let slot_chain_end : Mina_numbers.Global_slot.t option = None
let slot_chain_end : int option = None

[%%else]

[%%inject "slot_chain_end", slot_chain_end]

let slot_chain_end = Some (Mina_numbers.Global_slot.of_int slot_chain_end)
let slot_chain_end = Some slot_chain_end

[%%endif]
7 changes: 3 additions & 4 deletions src/lib/runtime_config/runtime_config.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1383,10 +1383,9 @@ let make_fork_config ~staged_ledger ~global_slot ~blockchain_length

let slot_tx_end_or_default, slot_chain_end_or_default =
let f compile get_runtime t =
Option.value_map t.daemon ~default:compile ~f:(fun daemon ->
Option.merge compile ~f:(fun _c r -> r)
@@ Option.map ~f:Mina_numbers.Global_slot.of_int
@@ get_runtime daemon )
Option.map ~f:Mina_numbers.Global_slot.of_int
@@ Option.value_map t.daemon ~default:compile ~f:(fun daemon ->
Option.merge compile ~f:(fun _c r -> r) @@ get_runtime daemon )
in
( f Mina_compile_config.slot_tx_end (fun d -> d.slot_tx_end)
, f Mina_compile_config.slot_chain_end (fun d -> d.slot_chain_end) )
Expand Down

0 comments on commit 4adc91f

Please sign in to comment.