Commit 4c21458
committed
refactor(api): migrate JSON instances to Exp.IsEra constraints
Refactors ToJSON/FromJSON instances for key types to use the new
Exp.IsEra constraint system instead of the legacy IsShelleyBasedEra
and IsCardanoEra constraints. This modernizes the codebase to use
the experimental era infrastructure while maintaining backwards
compatibility.
- Migrate AddressInEra JSON instances to use Exp.IsEra
- Update ReferenceScript serialization to use new constraints
- Refactor TxOut (CtxTx and CtxUTxO) JSON parsing to use Exp.convert
- Simplify TxOutValue JSON handling with unified era conversion
- Consolidate duplicate parsing logic for Babbage/Conway/Dijkstra eras
- Remove era-specific case matching in favor of generic implementations
The refactoring eliminates significant code duplication by using the
convert function to obtain appropriate era witnesses, making the code
more maintainable while preserving the exact JSON format.1 parent e789c02 commit 4c21458
File tree
4 files changed
+97
-283
lines changed- cardano-api/src/Cardano/Api
- Plutus/Internal
- Tx/Internal
4 files changed
+97
-283
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| |||
370 | 371 | | |
371 | 372 | | |
372 | 373 | | |
373 | | - | |
374 | | - | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
375 | 377 | | |
376 | | - | |
| 378 | + | |
377 | 379 | | |
378 | | - | |
| 380 | + | |
379 | 381 | | |
380 | 382 | | |
381 | 383 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
| |||
1647 | 1648 | | |
1648 | 1649 | | |
1649 | 1650 | | |
1650 | | - | |
| 1651 | + | |
1651 | 1652 | | |
1652 | 1653 | | |
1653 | 1654 | | |
1654 | | - | |
| 1655 | + | |
1655 | 1656 | | |
1656 | | - | |
1657 | | - | |
1658 | | - | |
1659 | | - | |
| 1657 | + | |
| 1658 | + | |
1660 | 1659 | | |
1661 | 1660 | | |
1662 | 1661 | | |
| |||
0 commit comments