go-ethereum
go-ethereum copied to clipboard
core/types,internal/ethapi: Add tests for round tripping transaction JSON
Checks that Transaction.MarshalJSON and newRPCTransaction JSON output can be parsed by Transaction.UnmarshalJSON
The duplication of the allTransactionTypes helper function is rather unfortunate. If there's a good place to put a shared version of that I'm happy to move it - just point me at the right place. :)
I refactored it a bit -- now it's only in internal/ethapi, where it can perform both tests. Semantically, that's a bit odd, since arguably the 'types' test should be done in 'types' and not a satellite package. I'd argue that we get the same coverage doing it like this, but less clutter and copied code.
Yeah that makes sense. Avoiding the duplication is a good tradeoff for the tests being in the "wrong" package. Looks like the windows build failed TestSkeletonSyncRetrievals which I'm guessing in flaky.