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

Add new types to CDDL list and test forward compatibility of deserialiseTxLedgerCddl #634

Merged
merged 3 commits into from
Sep 17, 2024

Conversation

palas
Copy link
Contributor

@palas palas commented Sep 11, 2024

Changelog

- description: |
    Added new types to CDDL and added test for forward compatibility of `deserialiseTxLedgerCddl`
# uncomment types applicable to the change:
  type:
  - bugfix         # fixes a defect
  - test           # fixes/modifies tests

Context

There was an issue with transactions created using the non-deprecated function serialiseToTextEnvelope as alternative to serialiseTxLedgerCddl. Because the implementation in cardano-cli still doesn't accept it.

This PR adds a test ensuring the deserialiseTxLedgerCddl function is compatible with serialiseToTextEnvelope.

It also adds the new types to the list of cddlTypeToEra conversion function, this is necessary for the corresponding fix in cardano-cli: IntersectMBO/cardano-cli#892

How to trust this PR

The change is small. Probably just make sure you agree with the direction of the change.

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

Copy link
Contributor

@Jimbo4350 Jimbo4350 left a comment

Choose a reason for hiding this comment

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

LGTM! We need to remove all the type strings that are not defined in a HasTextEnvelope instance.

@@ -32,6 +33,18 @@ import Test.Tasty.Hedgehog (testProperty)
-- TODO: Need to add PaymentExtendedKey roundtrip tests however
-- we can't derive an Eq instance for Crypto.HD.XPrv

prop_forward_compatibility_txbody_CBOR :: Property
Copy link
Contributor

@carbolymer carbolymer Sep 16, 2024

Choose a reason for hiding this comment

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

This test does the same as the one below, however prop_roundtrip_txbody_CBOR uses a deprecated function. I guess it would be nice to add a comment with that information.

@Jimbo4350 when should we remove already deprecated API functions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added comment here: b33f0af

@palas palas added this pull request to the merge queue Sep 17, 2024
Merged via the queue into main with commit 9b3cbd9 Sep 17, 2024
26 checks passed
@palas palas deleted the fix-new-type-issues branch September 17, 2024 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working test Adding or reworking tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants