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

Error when passing large numbers to RPC endpoints that expect u128 #2516

Closed
monitz87 opened this issue Aug 25, 2020 · 2 comments
Closed

Error when passing large numbers to RPC endpoints that expect u128 #2516

monitz87 opened this issue Aug 25, 2020 · 2 comments

Comments

@monitz87
Copy link
Contributor

When using custom RPCs that receive inputs of type u128, passing numbers with hex representations with 14 significant digits or more results in an error.

For example, passing the number 4503599627370496 (0x10000000000000 in hex, 14 digits) will have the node respond with -32602: Invalid params: invalid type: string "0x00000000000000000010000000000000", expected u128.. Passing one less, 4503599627370496 (which is 0xfffffffffffff in hex, 13 digits) works just fine.

Steps to reproduce: https://polkadot.js.org/apps/#/rpc (Edgeware chain), contracts.call endpoint, input 4503599627370495 (atto), submit. All should work fine. Attempt the same with 4503599627370496 and you should get an error.

@jacogr
Copy link
Member

jacogr commented Aug 25, 2020

This sits on the node side, the error comes from there. (The serialization from the JS side is correct)

As for Edgeware, that version does not yet support hex inputs, that was added recently. See paritytech/substrate#6321

@polkadot-js-bot
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators Jun 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants