Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

int64 over 0xffffffff (negative) are not stringified when encoded to JSON #38

Open
abourget opened this issue Nov 9, 2018 · 1 comment
Labels
bug Something isn't working

Comments

@abourget
Copy link

abourget commented Nov 9, 2018

A json-serialized uint64 gets swapped for a string over 0xffffffff, but not when a int64 has a larger than 32 bits value, but is negative.

That's in https://github.com/EOSIO/fc/blob/master/src/io/json.cpp#L614

Example:

      "int64": -2714170076832633519,
      "uint64": "2714170076832633519",
abourget added a commit to eoscanada/eos-go that referenced this issue Nov 9, 2018
Encode as string when larger than 0xffffffff as the blockchain does
(or is supposed to do EOSIO/fc#38)
@tbfleming tbfleming added the bug Something isn't working label Nov 9, 2018
@tbfleming
Copy link
Contributor

This will cause a precision loss in javascript clients.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants