Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create-testnet-data: fix that treasury could be unexpectedly negative #644

Merged
merged 3 commits into from
Mar 12, 2024

Conversation

smelc
Copy link
Contributor

@smelc smelc commented Mar 11, 2024

Changelog

- description: |
    create-testnet-data: fix that treasury could be unexpectedly negative
# 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
  - improvement    # QoL changes e.g. refactoring
  - 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

Fixes #643

How to trust this PR

I wanted to test that cabal test cardano-testnet passed on cardano-node, using this version of cardano-cli; but it's not easy to do right now. Still I think this is safe.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. See Running tests for more details
  • Self-reviewed the diff

@smelc smelc force-pushed the smelc/fix-treasury-subtrahend branch from d55c46d to 54052e3 Compare March 11, 2024 14:27
@smelc smelc force-pushed the smelc/fix-treasury-subtrahend branch from 54052e3 to cdb4e93 Compare March 11, 2024 14:48
@smelc smelc force-pushed the smelc/fix-treasury-subtrahend branch from cdb4e93 to 08c71fa Compare March 11, 2024 14:50
@smelc smelc marked this pull request as ready for review March 12, 2024 10:36
@smelc smelc added this pull request to the merge queue Mar 12, 2024
Merged via the queue into main with commit 33599f2 Mar 12, 2024
20 checks passed
@smelc smelc deleted the smelc/fix-treasury-subtrahend branch March 12, 2024 12:07
Copy link
Contributor

@Jimbo4350 Jimbo4350 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

GenesisCmdDelegatedSupplyExceedsTotalSupply delegated total ->
"Provided delegated supply is " <> pretty delegated <> ", which is greater than the specified total supply: " <> pretty total <> "." <>
"This is incorrect: the delegated supply should be less or equal to the total supply." <>
" Note that the total supply can either come from --total-supply or from the default template. Please fix what you use."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which one takes precedent? The template or the cli parser?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jimbo4350> the template takes precedence 👍

nonDelegCoin = getCoinForDistribution nonDelegCoinRaw
delegCoin = getCoinForDistribution delegCoinRaw

getCoinForDistribution :: Integer -> Natural
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm. I don't like these hidden calculations. It is always better to be explicit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jimbo4350> note that it was like this before in create-staked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

create-testnet-data: treasury can be unexpectedly negative
3 participants