IntersectMBO / cardano-cli

This repository contains sources for the command-line interface (CLI) tool for interacting with the Cardano blockchain.
Apache License 2.0
43 stars 15 forks source link

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

Closed smelc closed 7 months ago

smelc commented 7 months ago

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