Remove Coders from testlibs and tests#5865
Merged
Merged
Conversation
6d9af1d to
aeb3b0c
Compare
aeb3b0c to
8dad27e
Compare
8dad27e to
5b7acf1
Compare
There was a problem hiding this comment.
Pull request overview
This PR continues the #5718 effort by removing usage of Cardano.Ledger.Binary.Coders from test libraries and test code, switching test-side CBOR encoders/decoders to the newer Cardano.Ledger.Binary primitives (encodeListLen, decodeRecordNamed, decodeRecordSum, decodeSparseKeyed).
Changes:
- Replace
Coders-based record/sum encoding and decoding withencodeListLen+ directencCBOR, anddecodeRecordNamed/decodeRecordSum. - Migrate sparse-keyed decoding in test annotators to
decodeSparseKeyed. - Add
OverloadedStringswhere needed forText-typed decoder names.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| libs/cardano-ledger-test/src/Test/Cardano/Ledger/Constrained/Conway/WitnessUniverse.hs | Switch WitUniv CBOR encoding from Coders.Rec to encodeListLen + field encodings. |
| libs/cardano-ledger-test/src/Test/Cardano/Ledger/Constrained/Conway/Utxo.hs | Replace Coders sum/record encode/decode with decodeRecordSum + encodeListLen/encodeWord. |
| libs/cardano-ledger-test/src/Test/Cardano/Ledger/Constrained/Conway/Instances/Ledger.hs | Update ProposalsSplit CBOR instances to non-Coders primitives (encodeListLen, decodeRecordNamed). |
| libs/cardano-ledger-core/testlib/Test/Cardano/Ledger/Core/KeyPair.hs | Switch KeyPair CBOR encoding from Coders.Rec to encodeListLen + field encodings. |
| libs/cardano-ledger-conformance/src/Test/Cardano/Ledger/Conformance/ExecSpecRule/Conway/Ledger.hs | Remove Coders from exec-context CBOR encoding; use encodeListLen. |
| libs/cardano-ledger-conformance/src/Test/Cardano/Ledger/Conformance/ExecSpecRule/Conway/Cert.hs | Remove Coders from exec-context CBOR encode/decode; use encodeListLen/decodeRecordNamed. |
| eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/Binary/Annotator.hs | Replace Coders record + sparse-keyed decoding with decodeRecordNamed/decodeSparseKeyed. |
| eras/alonzo/impl/testlib/Test/Cardano/Ledger/Alonzo/Translation/TranslationInstance.hs | Replace Coders record encode/decode for TranslationInstance with encodeListLen/decodeRecordNamed. |
| eras/alonzo/impl/testlib/Test/Cardano/Ledger/Alonzo/Binary/Annotator.hs | Remove Coders usage in multiple Alonzo annotator decoders; use decodeRecordNamed, decodeSparseKeyed, decodeRecordSum. |
| eras/allegra/impl/testlib/Test/Cardano/Ledger/Allegra/Binary/Annotator.hs | Replace Coders decode helpers with direct decoders and decodeRecordNamed/decodeRecordSum. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d96dca4 to
3c776ba
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Part of addressing #5718
Checklist
CHANGELOG.mdfiles updated for packages with externally visible changes.NOTE: New section is never added with the code changes. (See RELEASING.md).
.cabalandCHANGELOG.mdfiles when necessary, according to theversioning process.
.cabalfiles updated when necessary.NOTE: If bounds change in a cabal file, that package itself must have a version increase. (See RELEASING.md).
scripts/fourmolize.sh).scripts/cabal-format.sh).scripts/gen-cddl.sh)hie.yamlupdated (usescripts/gen-hie.sh).