Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changes/20260527_cardano_api_validation_1_2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
project: cardano-api
pr: 1227
kind:
Comment on lines +1 to +3
- maintenance
description: |
Migrate to validation >= 1.2 API, replacing removed toEither and liftError with direct pattern matching on Failure/Success constructors. Bump hackage index-state to 2026-05-27.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,5 @@ cardano-wasm/examples/*/cardano-api.js
cardano-wasm/examples/*/main.js
cardano-wasm/examples/*/cardano_node_grpc_web_pb.js
.ghc-wasm/
.serena/

2 changes: 1 addition & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repository cardano-haskell-packages
-- See CONTRIBUTING for information about these, including some Nix commands
-- you need to run if you change them
index-state:
, hackage.haskell.org 2026-04-17T09:20:55Z
, hackage.haskell.org 2026-05-27T06:20:37Z
, cardano-haskell-packages 2026-05-25T13:25:40Z

active-repositories:
Expand Down
2 changes: 1 addition & 1 deletion cardano-api/cardano-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ library
transformers,
transformers-except ^>=0.1.3,
typed-protocols ^>=1.2,
validation,
validation >=1.2,
vector,
yaml,

Expand Down
25 changes: 11 additions & 14 deletions cardano-api/src/Cardano/Api/Tx/Internal/Sign.hs
Original file line number Diff line number Diff line change
Expand Up @@ -777,20 +777,17 @@ decodeShelleyBasedWitness
-> ByteString
-> Either CBOR.DecoderError (KeyWitness era)
decodeShelleyBasedWitness sbe bs =
let e =
Valid.toEither $
mconcat $
map
(Valid.liftError return)
[ bootstrapWitnessDecoder bs
, shelleyKeyWitnessDecoder bs
, legacyKeyWitnessDecoder bs
]
in case e of
Left errs ->
let allErrs = Text.unlines $ map renderBuildable errs
in Left $ CBOR.DecoderErrorCustom "Failed to deserialise key witness" allErrs
Right res -> return res
case mconcat $
map
(either (Valid.Failure . pure) Valid.Success)
[ bootstrapWitnessDecoder bs
, shelleyKeyWitnessDecoder bs
, legacyKeyWitnessDecoder bs
] of
Valid.Failure errs ->
let allErrs = Text.unlines $ map renderBuildable errs
in Left $ CBOR.DecoderErrorCustom "Failed to deserialise key witness" allErrs
Valid.Success res -> return res
where
shelleyKeyWitnessDecoder b =
ShelleyKeyWitness sbe
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading