-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Rpc: Filter accounts with invalid mints from get_parsed_token_accounts #11844
Rpc: Filter accounts with invalid mints from get_parsed_token_accounts #11844
Conversation
@jstarry , the biggest question mark in my mind about this approach is whether to special-case |
Codecov Report
@@ Coverage Diff @@
## master #11844 +/- ##
=======================================
Coverage 82.1% 82.1%
=======================================
Files 330 330
Lines 77588 77601 +13
=======================================
+ Hits 63701 63735 +34
+ Misses 13887 13866 -21 |
@CriesofCarrots I could see a case either way but I'm in favor of filtering them out. Like you said: "users that want to access all accounts, regardless of mint validity, will need to use another encoding." That being said, I think we should add a disclaimer to the docs that explains that invalid accounts will not be returned. |
automerge label removed due to a CI failure |
#11844) (#11859) * Filter out accounts with invalid mints from get_parsed_token_accounts * Explicit docs (cherry picked from commit 1988ee9) Co-authored-by: Tyera Eulberg <[email protected]>
#11844) (#11858) * Filter out accounts with invalid mints from get_parsed_token_accounts * Explicit docs (cherry picked from commit 1988ee9) Co-authored-by: Tyera Eulberg <[email protected]>
Problem
Several token rpc endpoints can return mixed parsed and unparsed token accounts when jsonParsed encoding is requested: this happens if the token account's mint cannot be found or is not valid, resulting in a
no mint_decimals
error when account-decoder attempts to parse the account. Account-decoder then defaults to unparsed.This is problematic for clients that would like to know all results will be in the same format.
Summary of Changes