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

Clean up constraints on Proposal and Vote instances, add their generators for tests #118

Merged
merged 1 commit into from
Jul 28, 2023

Conversation

carbolymer
Copy link
Contributor

@carbolymer carbolymer commented Jul 13, 2023

Changelog

- description: |
    Clean up constraints on Proposal and Vote instances, add their generators for tests
  # no-api-changes: the API has not changed
  # compatible: the API has changed but is non-breaking
  # breaking: the API has changed in a breaking way
  compatibility: compatible
  # feature: the change implements a new feature in the API
  # bugfix: the change fixes a bug in the API
  # test: the change fixes modifies tests
  # maintenance: the change involves something other than the API
  # If more than one is applicable, it may be put into a list.
  type: bugfix

Context

n/a

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • The change log section in the PR description has been filled in
  • New tests are added if needed and existing tests are updated. These may include:
    • golden tests
    • property tests
    • roundtrip tests
  • The version bounds in .cabal files are updated
  • CI passes. See note on CI. The following CI checks are required:
    • Code is linted with hlint. See .github/workflows/check-hlint.yml to get the hlint version
    • Code is formatted with stylish-haskell. See .github/workflows/stylish-haskell.yml to get the stylish-haskell version
    • Code builds on Linux, MacOS and Windows for ghc-8.10.7 and ghc-9.2.7
  • The changelog section in the PR is updated to describe the change
  • Self-reviewed the diff

Note on CI

If your PR is from a fork, the necessary CI jobs won't trigger automatically for security reasons.
You will need to get someone with write privileges. Please contact IOG node developers to do this
for you.

@carbolymer carbolymer force-pushed the mgalazyn/fix/more-conway-todos branch 3 times, most recently from 2e4cde3 to 4d23d54 Compare July 17, 2023 21:07
@carbolymer carbolymer marked this pull request as ready for review July 18, 2023 07:41
@carbolymer carbolymer force-pushed the mgalazyn/fix/more-conway-todos branch from 4d23d54 to be7baa3 Compare July 18, 2023 13:14
@carbolymer carbolymer changed the title Add constraints to Proposal and Vote types Clean up constraints on Proposal and Vote instances, add their generators for tests Jul 18, 2023
) => FromCBOR (Vote era) where
fromCBOR = Vote <$> Shelley.fromEraCBOR @Conway.Conway
instance IsShelleyBasedEra era => ToCBOR (Vote era) where
toCBOR (Vote vp) = obtainEraConstraints sbe $ Shelley.toEraCBOR @Conway.Conway vp
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah so this is problematic because it assumes things won't change in future eras. We can update the Vote era type with the ConwayEraOnwards era GADT, See StakeDelegationRequirementsConwayOnwards as an example.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've changed type application to (ShelleyLedgerEra era) - that should fix the CBOR en/decoding for eras != Conway. Do you also mean that we should add a constructor parameter with type ConwayEraOnwards era?

@carbolymer carbolymer requested review from mkoura and removed request for mkoura July 19, 2023 14:03
@carbolymer carbolymer force-pushed the mgalazyn/fix/more-conway-todos branch 2 times, most recently from 639cad0 to 040b619 Compare July 21, 2023 18:37
@carbolymer carbolymer force-pushed the mgalazyn/fix/more-conway-todos branch from 040b619 to 81e2f5b Compare July 28, 2023 11:15
@carbolymer carbolymer added this pull request to the merge queue Jul 28, 2023
Merged via the queue into main with commit aeacbde Jul 28, 2023
@carbolymer carbolymer deleted the mgalazyn/fix/more-conway-todos branch July 28, 2023 13:34
newhoggy pushed a commit that referenced this pull request Mar 11, 2024
…x-in-ci-for-mac

Remove ghc-9.2.x in CI for Mac
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.

2 participants