diff options
author | Felix Lange <fjl@twurst.com> | 2017-02-23 00:35:11 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2017-03-02 21:05:46 +0800 |
commit | f3b7dcc5bdd5b2b02e12133a0d8e16a75844f766 (patch) | |
tree | 8ec56c1b7e2aa996184a8b8c5f1a1d9eefb4f92b /common/hexutil/hexutil_test.go | |
parent | c52ab932e61ef9eba37c107e8b58b22c7d32e6c2 (diff) | |
download | dexon-f3b7dcc5bdd5b2b02e12133a0d8e16a75844f766.tar dexon-f3b7dcc5bdd5b2b02e12133a0d8e16a75844f766.tar.gz dexon-f3b7dcc5bdd5b2b02e12133a0d8e16a75844f766.tar.bz2 dexon-f3b7dcc5bdd5b2b02e12133a0d8e16a75844f766.tar.lz dexon-f3b7dcc5bdd5b2b02e12133a0d8e16a75844f766.tar.xz dexon-f3b7dcc5bdd5b2b02e12133a0d8e16a75844f766.tar.zst dexon-f3b7dcc5bdd5b2b02e12133a0d8e16a75844f766.zip |
common/hexutil: reject big integer inputs > 256 bits
This follows the change to common/math big integer parsing in PR #3699.
Diffstat (limited to 'common/hexutil/hexutil_test.go')
-rw-r--r-- | common/hexutil/hexutil_test.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/common/hexutil/hexutil_test.go b/common/hexutil/hexutil_test.go index 324e9d348..68d8a40e0 100644 --- a/common/hexutil/hexutil_test.go +++ b/common/hexutil/hexutil_test.go @@ -83,6 +83,10 @@ var ( {input: `0x01`, wantErr: ErrLeadingZero}, {input: `0xx`, wantErr: ErrSyntax}, {input: `0x1zz01`, wantErr: ErrSyntax}, + { + input: `0x10000000000000000000000000000000000000000000000000000000000000000`, + wantErr: ErrBig256Range, + }, // valid {input: `0x0`, want: big.NewInt(0)}, {input: `0x2`, want: big.NewInt(0x2)}, @@ -99,6 +103,10 @@ var ( input: `0xffffffffffffffffffffffffffffffffffff`, want: referenceBig("ffffffffffffffffffffffffffffffffffff"), }, + { + input: `0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff`, + want: referenceBig("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"), + }, } decodeUint64Tests = []unmarshalTest{ |