Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/app/runtime_genesis_ledger/runtime_genesis_ledger.ml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ let extract_accounts_exn = function
| { Runtime_config.Ledger.base = Accounts accounts
; num_accounts = None
; balances = []
(* ; add_genesis_winner = Some false *)
; _
; hash = _
; name = None
; add_genesis_winner = Some false
} ->
accounts
| _ ->
Expand Down
2 changes: 1 addition & 1 deletion src/lib/mina_graphql/mina_graphql.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4464,7 +4464,7 @@ module Queries = struct
Runtime_config.make_fork_config ~staged_ledger ~global_slot
~state_hash ~staking_ledger ~staking_epoch_seed
~next_epoch_ledger:(Some next_epoch_ledger) ~next_epoch_seed
~blockchain_length runtime_config
~blockchain_length
in
let%map () =
let open Async.Deferred.Infix in
Expand Down
20 changes: 14 additions & 6 deletions src/lib/runtime_config/runtime_config.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1286,16 +1286,15 @@ let ledger_accounts (ledger : Mina_base.Ledger.Any_ledger.witness) =
let ledger_of_accounts accounts =
Ledger.
{ base = Accounts accounts
; num_accounts = Some (List.length accounts)
; balances = List.mapi accounts ~f:(fun i a -> (i, a.balance))
; num_accounts = None
; balances = []
; hash = None
; name = None
; add_genesis_winner = Some false
}

let make_fork_config ~staged_ledger ~global_slot ~state_hash ~blockchain_length
~staking_ledger ~staking_epoch_seed ~next_epoch_ledger ~next_epoch_seed
(runtime_config : t) =
~staking_ledger ~staking_epoch_seed ~next_epoch_ledger ~next_epoch_seed =
let open Async.Deferred.Result.Let_syntax in
let global_slot_since_genesis = Mina_numbers.Global_slot.to_int global_slot in
let blockchain_length = Unsigned.UInt32.to_int blockchain_length in
Expand All @@ -1308,7 +1307,10 @@ let make_fork_config ~staged_ledger ~global_slot ~state_hash ~blockchain_length
Mina_base.Ledger.Any_ledger.cast (module Mina_base.Ledger) staged_ledger
|> ledger_accounts
in
let ledger = Option.value_exn runtime_config.ledger in
let hash =
Option.some @@ Mina_base.Ledger_hash.to_base58_check
@@ Mina_base.Ledger.merkle_root staged_ledger
in
let fork =
Fork_config.
{ state_hash = Mina_base.State_hash.to_base58_check state_hash
Expand Down Expand Up @@ -1348,7 +1350,13 @@ let make_fork_config ~staged_ledger ~global_slot ~state_hash ~blockchain_length
startup, even though it already exists, leading to an error.*)
~epoch_data
~ledger:
{ ledger with base = Accounts accounts; add_genesis_winner = Some false }
{ base = Accounts accounts
; num_accounts = None
; balances = []
; hash
; name = None
; add_genesis_winner = Some false
}
~proof:(Proof_keys.make ~fork ()) ()

let slot_tx_end_or_default, slot_chain_end_or_default =
Expand Down