mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
SendRawTransaction and SendRawTransactionSync currently return the bare UnmarshalBinary error to the JSON-RPC layer. Because the underlying decode errors don't implement rpc.Error.ErrorCode(), rpc/json.go:errorMessage falls back to errcodeDefault = -32000. Per JSON-RPC 2.0, malformed method parameters should use -32602 (InvalidParams), which is what Reth and Besu emit for the same input. internal/ethapi/errors.go already defines invalidParamsError with ErrorCode() = errCodeInvalidParams. Wire it into the two decode paths and add a parameterised test covering 5 distinct RLP-decode failure shapes against both entry points. |
||
|---|---|---|
| .. | ||
| override | ||
| testdata | ||
| addrlock.go | ||
| api.go | ||
| api_test.go | ||
| backend.go | ||
| capabilities.go | ||
| capabilities_test.go | ||
| dbapi.go | ||
| errors.go | ||
| logtracer.go | ||
| simulate.go | ||
| simulate_test.go | ||
| transaction_args.go | ||
| transaction_args_test.go | ||