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

Render the u128/i128 ScVal types as an integer instead of as the hi/lo pairs #354

Open
leighmcculloch opened this issue Mar 21, 2024 · 0 comments

Comments

@leighmcculloch
Copy link
Member

For example:

$ echo -n 'AAAACgAAAAAAAAAAAAAAAAAAAAE=' | stellar-xdr d --type ScVal
{"i128":{"hi":0,"lo":1}}

That is not very ergonomic to work with.

Instead, we could render it as:

$ echo -n 'AAAACgAAAAAAAAAAAAAAAAAAAAE=' | stellar-xdr d --type ScVal
{"i128":1}

In the same way we render u64/i64:

$ echo -n 'AAAABgAAAAAAAAAB' | stellar-xdr d --type ScVal
{"i64":1}

_There is the issue that JavaScript implementations of JSON parsers cannot parse integer values over the size of 53-bits correctly, so the number should also probably be stringified, but that needs addressing for the 64-bit ScVal types as well, and is a separate issue tracked in the following issue and tackled at the same time there:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant