IntersectMBO / cardano-cli

This repository contains sources for the command-line interface (CLI) tool for interacting with the Cardano blockchain.
Apache License 2.0
39 stars 14 forks source link

create-testnet-data: better behavior for create-testnet-data --total-supply and --delegated-supply #874

Closed smelc closed 2 weeks ago

smelc commented 3 weeks ago

Changelog

- description: |
    create-testnet-data's --total-supply option doesn't have a default anymore. The default value is to take the value from the shelley genesis file (if provided, otherwise this file is defaulted, so total supply comes from the default shelley genesis). create-testnet-data's --delegated-supply option doesn't have a default anymore. The default is to use half of the total supply.
# uncomment types applicable to the change:
  type:
  # - feature        # introduces a new feature
  - breaking       # the API has changed in a breaking way
  # - compatible     # the API has changed but is non-breaking
  # - optimisation   # measurable performance improvements
  # - refactoring    # QoL changes
  - bugfix         # fixes a defect
  # - test           # fixes/modifies tests
  # - maintenance    # not directly related to the code
  # - release        # related to a new release preparation
  # - documentation  # change in code docs, haddocks...

Context

Contributes to fixing https://github.com/IntersectMBO/cardano-node/issues/5953

The API for create-testnet-data's total supply and delegated supply was bad:

  1. --total-supply had a default value. So we would never pick up the value coming from the shelley genesis file. Now the behavior is that, if --total-supply is specified, it overrides the value from the shelley genesis file. Because the shelley genesis file is defaulted, there is always a value available.
  2. --delegated-supply had a default value. This does not play well with the value of total supply coming from either the genesis file or --total-supply. Now the default is to take half of the total supply (no matter from where it comes from).

How to trust this PR

Checklist