Commit 21408c8
committed
refactor(api): migrate ToJSON instances to use experimental Era type
Replaces IsCardanoEra constraint with Exp.IsEra in ToJSON instances
for TxOut and UTxO types, adopting the new experimental Era framework
for JSON serialization. This change simplifies the era handling by
using Exp.useEra instead of cardanoEra and reduces the pattern matching
cases in txOutToJsonValue to only handle ConwayEra and DijkstraEra.
- Update TxOut ToJSON instance to use Exp.IsEra constraint
- Update UTxO ToJSON instance to use Exp.IsEra constraint
- Refactor txOutToJsonValue to use Exp.Era type parameter
- Remove redundant pattern matches for Byron through Babbage eras
- Update test generators to use ShelleyBasedEraConway instead of Babbage
The test suite changes ensure compatibility with the new era handling
approach by testing against the Conway era, which provides better
coverage of the current serialization logic.1 parent 054d33c commit 21408c8
3 files changed
+16
-33
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| |||
338 | 339 | | |
339 | 340 | | |
340 | 341 | | |
341 | | - | |
342 | | - | |
| 342 | + | |
| 343 | + | |
343 | 344 | | |
344 | | - | |
| 345 | + | |
345 | 346 | | |
346 | 347 | | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
| 348 | + | |
369 | 349 | | |
370 | 350 | | |
371 | 351 | | |
| |||
375 | 355 | | |
376 | 356 | | |
377 | 357 | | |
378 | | - | |
| 358 | + | |
379 | 359 | | |
380 | 360 | | |
381 | 361 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
85 | 84 | | |
86 | 85 | | |
87 | 86 | | |
88 | 87 | | |
89 | 88 | | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| |||
Lines changed: 8 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
24 | 27 | | |
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
31 | | - | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
36 | | - | |
| 39 | + | |
37 | 40 | | |
38 | 41 | | |
39 | 42 | | |
40 | 43 | | |
41 | | - | |
| 44 | + | |
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
46 | | - | |
| 49 | + | |
47 | 50 | | |
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
51 | | - | |
| 54 | + | |
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
| |||
0 commit comments