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

Remove ConwayPool rule definition #4065

Merged
merged 3 commits into from
Feb 13, 2024
Merged

Conversation

lehins
Copy link
Contributor

@lehins lehins commented Feb 9, 2024

Description

Conway's POOL is identical to the one in Shelley. There is no need to redefine it.

This PR removes ConwayPool in favor of ShelleyPOOL

It also:

  • Removes usage of ShelleyTx in Shelley and Allegra rules in favor of Tx type family
  • Makes EraRule rule era invective in the rule. This will help avoid mistakes like this:
type instance EraRule "UTXOW" (ConwayEra c) = ConwayUTXOW (ConwayEra c)
type instance EraRule "UTXOS" (ConwayEra c) = ConwayUTXOW (ConwayEra c)

Unfortunately it can't be made injective in era as well, because of TICKN:

type instance EraRule "TICKN" (MaryEra _c) = TPraos.TICKN
type instance EraRule "TICKN" (AllegraEra _c) = TPraos.TICKN

Maybe in the future will be able to solve that one, which will help with type inference

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

@aniketd aniketd left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Thank you!

@lehins lehins force-pushed the lehins/remove-conway-pool-rule branch 2 times, most recently from a773ffd to 8b9c6dd Compare February 13, 2024 16:45
Reduce unnecessary code by reusing `ShelleyPOOL` rule, instead of
calling the logic from Shelley era and a new rule `ConwayPOOL` rule
@lehins lehins force-pushed the lehins/remove-conway-pool-rule branch from 8b9c6dd to e38d56e Compare February 13, 2024 19:05
@lehins lehins merged commit b002407 into master Feb 13, 2024
13 checks passed
@neilmayhew neilmayhew deleted the lehins/remove-conway-pool-rule branch March 8, 2024 21:07
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

2 participants