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

Fixing json parse error #285

Merged
merged 3 commits into from
Dec 31, 2021

Conversation

mcanerizci
Copy link
Contributor

Status Type ⚠️ Core Change Issue
Ready Bug No -

Problem

It throws a "JsonException" because it can not parse the json when the CustomError value is more than the maximum value of int.

It is possible to see this situation in dozens of slot, but you can see it in slot number 113766234 as an example.

image

Solution

Changed CustomError's type from int to long.

@tiago18c
Copy link
Member

Nice find. But to make sure we're doing this 100% accurately, can you change to uint instead?
The Custom variant takes a u32 argument.

Source: https://github.com/solana-labs/solana/blob/94a9b712b6985c8c0b7a55f824a394e35122de20/sdk/program/src/instruction.rs#L145

@mcanerizci
Copy link
Contributor Author

Yes you are right, uint is more convenient

@tiago18c
Copy link
Member

Thank you! Gonna merge. Expect a new version later

@tiago18c tiago18c merged commit fb6a7c5 into bmresearch:master Dec 31, 2021
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

Successfully merging this pull request may close these issues.

2 participants