Commit Graph

11 Commits

Author SHA1 Message Date
Steven Roose
afb8154eab common: improve IsHexAddress and add tests (#15551)
Also unexport isHex, hasHexPrefix because IsHexAddress is the only caller.

Fixes #15550
2017-12-04 19:34:15 +01:00
Jim McDonald
ad8d519eb5 common: tests for EIP55-compliant Address.Hex() 2017-07-16 13:28:22 +01:00
Felix Lange
4a741df757 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".
2017-06-27 13:15:12 +02:00
Felix Lange
d304da3803 common/hexutil: implement TextMarshaler, TextUnmarshaler
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.
2017-03-02 14:05:46 +01:00
Felix Lange
37e5816bcd common: use package hexutil for fixed size type encoding 2016-11-28 11:37:13 +01:00
Paulo L F Casaretto
a20d3fc362 common: Add tests for Address#UnmarshalJSON 2016-04-26 09:12:36 -03:00
Jeffrey Wilcke
d63e29241d common: added Hash unmarshal json length validation 2016-04-01 12:56:54 +02:00
Felix Lange
bfbcfbe4a9 all: fix license headers one more time
I forgot to update one instance of "go-ethereum" in commit 3f047be5a.
2015-07-23 18:35:11 +02:00
Felix Lange
3f047be5aa all: update license headers to distiguish GPL/LGPL
All code outside of cmd/ is licensed as LGPL. The headers
now reflect this by calling the whole work "the go-ethereum library".
2015-07-22 18:51:45 +02:00
Felix Lange
ea54283b30 all: update license information 2015-07-07 14:12:44 +02:00
obscuren
0fa7859b94 Fixed VM & Tests w/ conversion 2015-03-17 13:24:25 +01:00