Skip to content

Add Ord constraint on CertVRF in VRFAlgorithm#658

Merged
lehins merged 1 commit into
masterfrom
nm/certvrf-ord
May 20, 2026
Merged

Add Ord constraint on CertVRF in VRFAlgorithm#658
lehins merged 1 commit into
masterfrom
nm/certvrf-ord

Conversation

@neilmayhew
Copy link
Copy Markdown
Contributor

@neilmayhew neilmayhew commented May 19, 2026

Description

We want to be able to store ledger predicate failures in a Set, which requires an Ord constraint. Some of these failures transitively embed VRF certs so they too need to have Ord instances.

This change adds Ord instances for the three types of VRF provided in base. It also upgrades the Eq constraint to Ord in the VRFAlgorithm class to avoid having to repeat more specific constraints in many places in the ledger codebase.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated
  • All visible changes are prepended to the latest section of a CHANGELOG.md for the affected packages.
    New section is never added with the code changes. (See RELEASING.md)
  • When applicable, versions are updated in .cabal and CHANGELOG.md files according to the
    versioning process.
  • The version bounds in .cabal files for all affected packages are updated.
    If you change the bounds in a cabal file, that package itself must have a version increase. (See RELEASING.md)
  • Self-reviewed the diff

@neilmayhew neilmayhew changed the title Add Ord CertVRF constraint to VRFAlgorithm Strengthen Eq constraint on CertVRF in VRFAlgorithm to Ord May 19, 2026
@neilmayhew neilmayhew changed the title Strengthen Eq constraint on CertVRF in VRFAlgorithm to Ord Add Ord constraint on CertVRF in VRFAlgorithm May 19, 2026
Also add `Ord` instances to the `CertVRF`s of the three `VRFAlgorithm`
instances
@neilmayhew neilmayhew marked this pull request as ready for review May 19, 2026 22:06
@neilmayhew neilmayhew requested a review from lehins as a code owner May 19, 2026 22:06
Copy link
Copy Markdown
Collaborator

@lehins lehins left a comment

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 merged commit 9a18592 into master May 20, 2026
27 checks passed
@lehins lehins deleted the nm/certvrf-ord branch May 20, 2026 07:09
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.

2 participants