Skip to content

Migrate to validation >= 1.2#1227

Open
carbolymer wants to merge 1 commit into
masterfrom
mgalazyn/chore/bump-chap
Open

Migrate to validation >= 1.2#1227
carbolymer wants to merge 1 commit into
masterfrom
mgalazyn/chore/bump-chap

Conversation

@carbolymer
Copy link
Copy Markdown
Contributor

Summary

  • Migrate cardano-api from the pre-1.2 validation API (toEither, liftError) to direct pattern matching on Failure/Success constructors.
  • Add validation >= 1.2 lower bound in cardano-api.cabal.
  • Bump hackage index-state to 2026-05-27.

Context

validation 1.2 removed toEither, validate, and liftError.
This was found when bumping hackage.nix in CHaP (IntersectMBO/ouroboros-consensus#2051).

Blocked on a new CHaP release of ouroboros-consensus which also needs the same migration (already done on their main).

Test plan

  • CI passes once ouroboros-consensus is released to CHaP with validation 1.2 support

Copilot AI review requested due to automatic review settings May 27, 2026 07:38
@carbolymer carbolymer force-pushed the mgalazyn/chore/bump-chap branch from 9a6bc8e to 8596896 Compare May 27, 2026 07:38
@carbolymer carbolymer self-assigned this May 27, 2026
@carbolymer carbolymer force-pushed the mgalazyn/chore/bump-chap branch from 8596896 to e8f1e09 Compare May 27, 2026 07:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Migrates cardano-api off the pre-1.2 validation API by switching internal decoding logic to pattern-match on Validation’s Failure/Success, and updates build inputs (Cabal bounds + pinned package indexes) to support validation >= 1.2.

Changes:

  • Update internal witness decoding to accumulate decoder failures via Validation constructors (no toEither/liftError).
  • Add a validation >= 1.2 lower bound in cardano-api.cabal.
  • Bump cabal.project index-state and flake.lock to newer package sets; add .serena/ to .gitignore.

Reviewed changes

Copilot reviewed 4 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
flake.lock Updates pinned hackage.nix input to align with newer package set/index state.
cardano-api/src/Cardano/Api/Tx/Internal/Sign.hs Replaces removed validation helpers with Failure/Success pattern matching for decoder selection.
cardano-api/cardano-api.cabal Raises dependency lower bound to validation >= 1.2.
cabal.project Bumps Hackage index-state to 2026-05-27.
.gitignore Ignores .serena/ directory.
.changes/20260527_cardano_api_validation_1_2.yml Adds changelog fragment documenting the migration and index-state bump.

Comment on lines +1 to +3
project: cardano-api
pr: 1227
kind:
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