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/json_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/json_test.go')
-rw-r--r-- | common/hexutil/json_test.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/common/hexutil/json_test.go b/common/hexutil/json_test.go index 290bf9ca2..c7fde0adb 100644 --- a/common/hexutil/json_test.go +++ b/common/hexutil/json_test.go @@ -130,6 +130,10 @@ var unmarshalBigTests = []unmarshalTest{ {input: `"0x01"`, wantErr: ErrLeadingZero}, {input: `"0xx"`, wantErr: ErrSyntax}, {input: `"0x1zz01"`, wantErr: ErrSyntax}, + { + input: `"0x10000000000000000000000000000000000000000000000000000000000000000"`, + wantErr: ErrBig256Range, + }, // valid encoding {input: `""`, want: big.NewInt(0)}, @@ -148,6 +152,10 @@ var unmarshalBigTests = []unmarshalTest{ input: `"0xffffffffffffffffffffffffffffffffffff"`, want: referenceBig("ffffffffffffffffffffffffffffffffffff"), }, + { + input: `"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"`, + want: referenceBig("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"), + }, } func TestUnmarshalBig(t *testing.T) { |