Open
Description
Internal
Describe the feature you'd like
A cardano-api
method to extract genesis funds from the ledger config, like modeGenesisFunds :: Mode mode era -> LedgerConfig (BlockOf mode) -> [(Address era, Lovelace)]
, paired with a BlockOf mode
function, similarly to #1853 & #1858.
Note that (similarly to #1853, #1858, #1859) the type of the first argument (the indexed GADT Mode
) does not currently exist in cardano-api -- but exists in the generator.
This is currently implemented (with a slightly different signature) in the generator as:
modeGenesisFunds = \case
m@ModeShelley{} ->
fmap (fromShelleyAddr *** fromShelleyLovelace)
. Map.toList
. Consensus.sgInitialFunds
. Shelley.shelleyLedgerGenesis
$ modeLedgerConfig m
m@ModeByron{} ->
fmap (\(TxOut addr coin) -> (addr, coin))
. map (fromByronTxOut . Byron.fromCompactTxOut . snd)
. Map.toList
. Byron.unUTxO
. Byron.genesisUtxo
$ modeLedgerConfig m
m -> error $ "modeGenesisFunds: unsupported mode: " <> show m