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

key non-extended-key: make pattern matches exhaustive, so that we are notified of possible extensions #710

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

smelc
Copy link
Contributor

@smelc smelc commented Apr 9, 2024

Changelog

- description: |
    key non-extended-key: make pattern matches exhaustive, so that we are notified of possible extensions
# 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

There is a catch-all pattern when matching on https://github.com/IntersectMBO/cardano-api/blob/03de67a58e044c41c62ab8683bffac52771bcd37/cardano-api/internal/Cardano/Api/DeserialiseAnyOf.hs#L237 and it probably bit us in the past, when we extended this type and didn't see that we probably needed to extend the cases being handled.

This PR lists all cases of SomeAddressVerificationKey, so that we are notified of changes to make when extending this type.

How to trust this PR

It doesn't change the running behavior

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/exhaustive-pattern-match-for-glory-and-fame branch 2 times, most recently from 8c1534e to 933c9b7 Compare April 9, 2024 15:30
@smelc smelc force-pushed the smelc/exhaustive-pattern-match-for-glory-and-fame branch from 933c9b7 to ed8bb88 Compare April 9, 2024 15:32
@smelc smelc marked this pull request as ready for review April 9, 2024 15:49
@smelc smelc changed the title key non-extended-key: make pattern match exhaustive, so that we are notified of possible extensions key non-extended-key: make pattern matches exhaustive, so that we are notified of possible extensions Apr 9, 2024
@smelc smelc added this pull request to the merge queue Apr 10, 2024
Merged via the queue into main with commit ed62c1b Apr 10, 2024
19 checks passed
@smelc smelc deleted the smelc/exhaustive-pattern-match-for-glory-and-fame branch April 10, 2024 08:45
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