JSON generation in fc does not follow the standard for large negative numbers
JSON generation in fc handles only large positive numbers bigger than 32-bit integers, but does not handle negative 32-bit integers: https://gitlab.syncad.com/hive/hive/-/blob/develop/libraries/fc/src/io/json.cpp#L696
Eg. 10'000'000'000
will be appropriately parsed as: "10000000000"
, but for example: -10'000'000'000
will be parsed as -10000000000
(not a string)
Additionally, the maximum signed 32-bit integer value is 0x7fffffff
, not 0xffffffff
as in our repo!!
Also, the official JSON specification mentions Double-precision floating-point format standard (range [-(2**53)+1, (2**53)-1]
) as generally available and widely used, not numbers bigger than 32-bit integers: https://www.rfc-editor.org/rfc/rfc8259.html#section-6
Even though the majority of implementations (like Python or Javascript - are parsed as exponential numbers) support numbers larger than 64-bit, we should follow "the standard" and optionally support old JSON implementations - add the proper option to config.ini
(like json-int32-as-large-integer
).
Tests should cover this issue and confirm/invalidate it