aboutsummaryrefslogtreecommitdiffstats
path: root/common/hexutil/hexutil_test.go
Commit message (Collapse)AuthorAgeFilesLines
* common/hexutil: ensure negative big.Int is encoded sensiblyFelix Lange2017-03-021-0/+1
| | | | Restricting encoding is silly.
* common/hexutil: implement TextMarshaler, TextUnmarshalerFelix Lange2017-03-021-3/+11
| | | | | | | | | | | | | 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: don't leak encoding/hex errors in DecodeFelix Lange2017-03-021-5/+4
| | | | | All other functions return errors from package hexutil, ensure that Decode does too.
* common/hexutil: reject big integer inputs > 256 bitsFelix Lange2017-03-021-0/+8
| | | | This follows the change to common/math big integer parsing in PR #3699.
* common/hexutil: fix EncodeBig, Big.MarshalJSONFelix Lange2017-01-161-0/+1
| | | | | The code was too clever and failed to include zeros on a big.Word boundary.
* common/hexutil: fix Test{Decode,Unmarshal}Uint64 on 32bit arch (#3363)Felix Lange2016-11-281-1/+1
|
* common/hexutil: new package for 0x hex encodingFelix Lange2016-11-281-0/+186
The new package is purpose-built to handle the encoding consumed and produced by the RPC API.