File tree 2 files changed +6
-6
lines changed
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -27,9 +27,9 @@ const MaxAllowedInteger = 2<<53 - 1
27
27
const MaxJSONDepth = 10
28
28
29
29
// MaxIntegerPrec is the maximum precision allowed for big.Integer parsing.
30
- // It equals to the reference value and doesn't allow to precisely parse big
31
- // numbers, see the https://github.com/neo-project/neo/issues/2879 .
32
- const MaxIntegerPrec = 53
30
+ // It allows to properly parse integer numbers that our 256-bit VM is able to
31
+ // handle .
32
+ const MaxIntegerPrec = 1 << 8 + 1
33
33
34
34
// ErrInvalidValue is returned when an item value doesn't fit some constraints
35
35
// during serialization or deserialization.
Original file line number Diff line number Diff line change @@ -134,10 +134,10 @@ func TestFromToJSON(t *testing.T) {
134
134
// the C# one, ref. https://github.com/neo-project/neo/issues/2879.
135
135
func TestFromJSON_CompatBigInt (t * testing.T ) {
136
136
tcs := map [string ]string {
137
- `9.05e+28` : "90499999999999993918259200000 " ,
137
+ `9.05e+28` : "90500000000000000000000000000 " ,
138
138
`1.871e+21` : "1871000000000000000000" ,
139
- `3.0366e+32` : "303660000000000004445016810323968 " ,
140
- `1e+30` : "1000000000000000019884624838656 " ,
139
+ `3.0366e+32` : "303660000000000000000000000000000 " ,
140
+ `1e+30` : "1000000000000000000000000000000 " ,
141
141
}
142
142
for in , expected := range tcs {
143
143
t .Run (in , func (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments