common/hexutil: wrap errors in json.UnmarshalTypeError
This adds type and struct field context to error messages. Instead of "hex string of odd length" users will now see "json: cannot unmarshal hex string of odd length into Go struct field SendTxArgs.from of type common.Address".
Showing
- common/hexutil/hexutil.go 15 additions, 10 deletionscommon/hexutil/hexutil.go
- common/hexutil/json.go 36 additions, 11 deletionscommon/hexutil/json.go
- common/hexutil/json_test.go 32 additions, 32 deletionscommon/hexutil/json_test.go
- common/types.go 15 additions, 0 deletionscommon/types.go
- common/types_test.go 4 additions, 6 deletionscommon/types_test.go
Loading
Please register or sign in to comment