Commit 1ef93a9
refactor(testing): inline networking decode-failure dispatch (leanEthereum#1156)
Replace the module-level decoder lookup table with a match in its sole
consumer. The table mapped seven names to already-imported decoder
callables and was only ever read by the decode-failure attempt, so the
dispatch now lives where it is used.
- Delete the _DECODERS_BY_NAME table and its now-orphaned Callable and
Final imports.
- Dispatch by structural pattern matching on the decoder discriminator.
- Keep the hex decode inside the try, so malformed-hex input is still
caught and reported as the rejection.
Pure structural refactor: emitted vectors are byte-identical (verified by
filling tests/consensus/lstar/networking before and after).
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent f4b15b5 commit 1ef93a9
1 file changed
Lines changed: 17 additions & 15 deletions
Lines changed: 17 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
| |||
654 | 653 | | |
655 | 654 | | |
656 | 655 | | |
657 | | - | |
658 | | - | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | | - | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | 656 | | |
670 | 657 | | |
671 | 658 | | |
| |||
689 | 676 | | |
690 | 677 | | |
691 | 678 | | |
692 | | - | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
693 | 695 | | |
694 | 696 | | |
695 | 697 | | |
| |||
0 commit comments