-
Notifications
You must be signed in to change notification settings - Fork 914
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
Fixed the type for lamport #1286
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm looking at the RPC responses in the docs and they appear to be u64 everywhere.
> curl https://api.mainnet-beta.solana.com -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getRecentBlockhash"}
'
{"jsonrpc":"2.0","result":{"context":{"apiVersion":"1.13.7","slot":192403900},"value":{"blockhash":"D59Fvi8JpnEMBdbeRX2PbfZreqrd2R5kxn3FAYkfWHNf","feeCalculator":{"lamportsPerSignature":5000}}},"id":1}
While it would be great for these to be actual bigint
values, you can't serialize bigint
as JSON. Serializing the integer as a string over the wire is a good strategy, doing so as you've done in this PR would break old clients.
So shall I just make a js function throw an error if the value of lamports exceeds the limit |
This is actually how the new web3.js rewrite will behave (link). I think it's too late at this point to change the behaviour of the existing library, because it would break existing apps. I'm sorry that you picked this issue up with the ‘good first issue’ tag. I think it might be more complicated than a quick fix. |
Oh my gosh. I am so sorry for bugging you. I was just trying to play around with this library and solve some simple issues to get involved in the community. I am closing the PR right away. |
No need to be sorry! Thank you for contributing to Solana! |
Because there has been no activity on this PR for 14 days since it was merged, it has been automatically locked. Please open a new issue if it requires a follow up. |
Fixes #1116