Skip to content

Commit

Permalink
Merge pull request #15022 from MinaProtocol/joaosreis/fix-nonconsensu…
Browse files Browse the repository at this point in the history
…s-dependencies

Remove dependency from mina_numbers from compile config
  • Loading branch information
joaosreis authored Feb 20, 2024
2 parents 6726fa9 + 9ecd8a4 commit f629039
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 @@ -1353,10 +1353,9 @@ let make_fork_config ~staged_ledger ~global_slot ~state_hash ~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 f629039

Please sign in to comment.