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

Added UnitTestTools and IncrementalStakeTest #4242

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

TimSheard
Copy link
Contributor

@TimSheard TimSheard commented Apr 5, 2024

This is a second try at addressing #4171.
It replaces PR #4211, which has been abandoned.

Issue #4171 identified some potential problems with the code in [eras/shelley/impl/src/Cardano/Ledger/Shelley/LedgerState/IncrementalStake.hs]. It suggested some tests to resolve the issue. Such a test need specific values with types such as Credential, StakeReference, UtxO, IncrementalStake, PParams, Rewards, Deposits, all with complex interrelation-ships.

Test.Cardano.Ledger.UnitTestTools makes it easy to express such relationships
Test.Cardano.Ledger.Shelley.UnitTests.IncrementalStakeTest exhibits a test, that resolves the issue.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated
  • When applicable, versions are updated in .cabal and CHANGELOG.md files according to the
    versioning process.
  • The version bounds in .cabal files for all affected packages are updated. If you change the bounds in a cabal file, that package itself must have a version increase. (See RELEASING.md)
  • All visible changes are prepended to the latest section of a CHANGELOG.md for the affected packages. New section is never added with the code changes. (See RELEASING.md)
  • Code is formatted with fourmolu (use scripts/fourmolize.sh)
  • Cabal files are formatted (use scripts/cabal-format.sh)
  • hie.yaml has been updated (use scripts/gen-hie.sh)
  • Self-reviewed the diff

Copy link
Contributor

@lehins lehins left a comment

Choose a reason for hiding this comment

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

The test looks awesome!

As usual I have a bunch of suggestions, but none of them are about the test case. Hopefully you'll like my suggestion to improve the tuple solution 😁

Copy link
Contributor

@lehins lehins left a comment

Choose a reason for hiding this comment

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

Beautiful.
Thank you for your patience, Tim!

Copy link
Contributor

@lehins lehins left a comment

Choose a reason for hiding this comment

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

Versioning is off.

eras/shelley/impl/cardano-ledger-shelley.cabal Outdated Show resolved Hide resolved
libs/cardano-data/cardano-data.cabal Outdated Show resolved Hide resolved
libs/cardano-data/CHANGELOG.md Outdated Show resolved Hide resolved
libs/cardano-ledger-core/cardano-ledger-core.cabal Outdated Show resolved Hide resolved
libs/cardano-ledger-core/src/Cardano/Ledger/Core.hs Outdated Show resolved Hide resolved
libs/cardano-ledger-core/CHANGELOG.md Outdated Show resolved Hide resolved
libs/cardano-data/src/Data/MonoTuple.hs Outdated Show resolved Hide resolved
eras/shelley/impl/cardano-ledger-shelley.cabal Outdated Show resolved Hide resolved
@TimSheard TimSheard force-pushed the ts-unitTestTools-version2 branch 6 times, most recently from 67c91ab to 03c5874 Compare April 10, 2024 15:48
@TimSheard TimSheard marked this pull request as ready for review April 10, 2024 15:49
…utes

the part of the stake attributed to rewards.
Copy link
Contributor

@lehins lehins left a comment

Choose a reason for hiding this comment

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

Perfect

@lehins lehins enabled auto-merge April 10, 2024 18:30
@lehins lehins merged commit 191a0fe into master Apr 10, 2024
13 of 15 checks passed
@lehins lehins deleted the ts-unitTestTools-version2 branch April 10, 2024 20:37
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.

None yet

3 participants