Commit a31ab03
committed
refactor(api): extract Babbage/Conway/Dijkstra parsing into unified helper
Creates parseBabbageOnwardsTxOut helper function to eliminate the final
source of duplication in the FromJSON instance. The three era cases
(Babbage, Conway, Dijkstra) now each call this single helper function.
This completes the refactoring by:
- Reducing the FromJSON instance by ~10 more lines
- Making the code structure clearer with simple era-based dispatch
- Consolidating all Babbage+ era parsing logic in one place
- Maintaining full backwards compatibility with all tests passing
The main case expression now clearly shows the parsing strategy for
each era, with complex logic extracted into well-named helper functions.1 parent 26e41b2 commit a31ab03
1 file changed
+15
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
455 | 455 | | |
456 | 456 | | |
457 | 457 | | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
473 | 461 | | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
474 | 474 | | |
475 | 475 | | |
476 | 476 | | |
| |||
0 commit comments