Merge #2468
2468: Replace `hardfork_at` with `eras` object r=Anviking a=Anviking
# Issue Number
ADP-676
# Overview
<!-- Detail in a few bullet points the work accomplished in this PR -->
- [x] Replace `hardfork_at` with info of all eras
- [x] Instead of storing ProtocolParameters in DB, just keep them in a `TVar`
- [ ] <s>See if we can order the eras correctly in the `era` object (for when the JSON is viewed by humans)</s> Seems impossible to do.
- [x] TODO: Extend swagger
- [ ] Tiny doc tweaks
# Comments
- Could add absolute `slot` field also
- Arguably a bit sad that the eras get sorted seemingly alphabetically in the json
```json
$ cardano-wallet network parameters
{
"slot_length": {
"quantity": 1,
"unit": "second"
},
"decentralization_level": {
"quantity": 74,
"unit": "percent"
},
"genesis_block_hash": "5f20df933584822601f9e3f8c024eb5eb252fe8cefb24d1317dc3d432e940ebb",
"blockchain_start_time": "2017-09-23T21:44:51Z",
"desired_pool_number": 500,
"epoch_length": {
"quantity": 432000,
"unit": "slot"
},
"eras": {
"shelley": {
"epoch_start_time": "2020-07-29T21:44:51Z",
"epoch_number": 208
},
"mary": null,
"byron": {
"epoch_start_time": "2017-09-23T21:44:51Z",
"epoch_number": 0
},
"allegra": {
"epoch_start_time": "2020-12-16T21:44:51Z",
"epoch_number": 236
}
},
"active_slot_coefficient": {
"quantity": 5,
"unit": "percent"
},
"security_parameter": {
"quantity": 2160,
"unit": "block"
},
"minimum_utxo_value": {
"quantity": 1000000,
"unit": "lovelace"
}
}
```
<!-- Additional comments or screenshots to attach if any -->
<!--
Don't forget to:
âś“ Self-review your changes to make sure nothing unexpected slipped through
âś“ Assign yourself to the PR
âś“ Assign one or several reviewer(s)
âś“ Jira will detect and link to this PR once created, but you can also link this PR in the description of the corresponding ticket
âś“ Acknowledge any changes required to the Wiki
âś“ Finally, in the PR description delete any empty sections and all text commented in <!--, so that this text does not appear in merge commit messages.
-->
Co-authored-by: Johannes Lund <[email protected]>