Skip to content

Remove Coders from testlibs and tests#5865

Merged
aniketd merged 1 commit into
masterfrom
aniketd/test-coders-removal
Jun 25, 2026
Merged

Remove Coders from testlibs and tests#5865
aniketd merged 1 commit into
masterfrom
aniketd/test-coders-removal

Conversation

@aniketd

@aniketd aniketd commented May 29, 2026

Copy link
Copy Markdown
Contributor

Description

Part of addressing #5718

Checklist

  • Commits in meaningful sequence and with useful messages.
  • Tests added or updated when needed.
  • CHANGELOG.md files updated for packages with externally visible changes.
    NOTE: New section is never added with the code changes. (See RELEASING.md).
  • Versions updated in .cabal and CHANGELOG.md files when necessary, according to the
    versioning process.
  • Version bounds in .cabal files updated when necessary.
    NOTE: If bounds change in a cabal file, that package itself must have a version increase. (See RELEASING.md).
  • Code formatted (use scripts/fourmolize.sh).
  • Cabal files formatted (use scripts/cabal-format.sh).
  • CDDL files are up to date (use scripts/gen-cddl.sh)
  • hie.yaml updated (use scripts/gen-hie.sh).
  • Self-reviewed the diff.

@aniketd aniketd force-pushed the aniketd/test-coders-removal branch from 6d9af1d to aeb3b0c Compare June 1, 2026 10:44
@aniketd aniketd marked this pull request as ready for review June 1, 2026 10:44
@aniketd aniketd requested a review from a team as a code owner June 1, 2026 10:44
@aniketd aniketd requested review from Soupstraw, lehins and teodanciu June 1, 2026 10:45
@aniketd aniketd force-pushed the aniketd/test-coders-removal branch from aeb3b0c to 8dad27e Compare June 24, 2026 14:50
Base automatically changed from aniketd/coders to master June 24, 2026 16:22
Copilot AI review requested due to automatic review settings June 25, 2026 10:18
@aniketd aniketd force-pushed the aniketd/test-coders-removal branch from 8dad27e to 5b7acf1 Compare June 25, 2026 10:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 with encodeListLen + direct encCBOR, and decodeRecordNamed/decodeRecordSum.
  • Migrate sparse-keyed decoding in test annotators to decodeSparseKeyed.
  • Add OverloadedStrings where needed for Text-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.

@lehins lehins left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Very nice! Thank you!

@lehins lehins enabled auto-merge June 25, 2026 11:01
@aniketd aniketd disabled auto-merge June 25, 2026 11:37
@aniketd aniketd enabled auto-merge June 25, 2026 11:42
@aniketd aniketd force-pushed the aniketd/test-coders-removal branch from d96dca4 to 3c776ba Compare June 25, 2026 14:33
@aniketd aniketd merged commit 9180ef5 into master Jun 25, 2026
51 checks passed
@aniketd aniketd deleted the aniketd/test-coders-removal branch June 25, 2026 16:42
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.

3 participants