aboutsummaryrefslogtreecommitdiffstats
path: root/common/hexutil/json.go
Commit message (Collapse)AuthorAgeFilesLines
* build: enable unconvert linter (#15456)ferhat elmas2017-11-111-1/+1
| | | | | | | | | * build: enable unconvert linter - fixes #15453 - update code base for failing cases * cmd/puppeth: replace syscall.Stdin with os.Stdin.Fd() for unconvert linter
* common: fix megacheck warningsEgon Elbre2017-08-071-5/+4
|
* common/hexutil: wrap errors in json.UnmarshalTypeErrorFelix Lange2017-06-271-11/+36
| | | | | | | 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".
* common/hexutil: add UnmarshalFixedUnprefixedTextFelix Lange2017-03-231-5/+27
|
* common/hexutil: ensure negative big.Int is encoded sensiblyFelix Lange2017-03-021-15/+3
| | | | Restricting encoding is silly.
* common/hexutil: implement TextMarshaler, TextUnmarshalerFelix Lange2017-03-021-54/+69
| | | | | | | | | | | | | This commit makes the wrapper types more generally applicable. encoding.TextMarshaler is supported by most codec implementations (e.g. for yaml). The tests now ensure that package json actually recognizes the custom marshaler implementation irrespective of how it is implemented. The Uint type has new tests, too. These are tricky because uint size depends on the CPU word size. Turns out that there was one incorrect case where decoding returned ErrUint64Range instead of ErrUintRange.
* common/hexutil: reject big integer inputs > 256 bitsFelix Lange2017-03-021-3/+9
| | | | This follows the change to common/math big integer parsing in PR #3699.
* common/hexutil: fix EncodeBig, Big.MarshalJSONFelix Lange2017-01-161-7/+2
| | | | | The code was too clever and failed to include zeros on a big.Word boundary.
* common/hexutil: allow empty strings when decoding JSON (#3559)Felix Lange2017-01-131-2/+2
|
* common/hexutil: new package for 0x hex encodingFelix Lange2016-11-281-0/+271
The new package is purpose-built to handle the encoding consumed and produced by the RPC API.