solana
solana copied to clipboard
rpc: parse token accounts in simulate_transaction
Problem
jsonParsed will never work for token accounts because we missed decimals.
Summary of Changes
~add new parsing code for JsonParsed. it will~
~- check if accounts's owner is token program~
~- get mint account data from either post_simulation_accounts or bank and decimals from it.~
updated:
add a new func arg, overwrite_accounts, to fn get_encoded_account and fn get_parsed_token_account.
Codecov Report
Attention: 1 lines in your changes are missing coverage. Please review.
Comparison is base (
e2c2029) 81.7% compared to head (6e60b1a) 81.8%. Report is 1 commits behind head on master.
:exclamation: Current head 6e60b1a differs from pull request most recent head 6407b27. Consider uploading reports for the commit 6407b27 to get more accurate results
Additional details and impacted files
@@ Coverage Diff @@
## master #34619 +/- ##
========================================
Coverage 81.7% 81.8%
========================================
Files 825 825
Lines 223261 222316 -945
========================================
- Hits 182605 181955 -650
+ Misses 40656 40361 -295
just updated with a new attempt. I passed a new variable overwrite_accounts into those parsing functions.
I opened the issue for this yesterday, forgot to check for an open PR first sorry! One reason it hasn't been complained about before is that the legacy web3js doesn't expose the accounts encoding option, so everyone there has been stuck with base64 on all accounts. I came across this issue building with the new web3js which exposes the accounts encoding.
I've also mentioned the issue to @joncinque and he suggested that we might be able to backport this to 1.17, since it only affects the JSON RPC and is a bug. If that is possible then it'd be really helpful!
Backports to the beta branch are to be avoided unless absolutely necessary for fixing bugs, security issues, and perf regressions. Changes intended for backport should be structured such that a minimum effective diff can be committed separately from any refactoring, plumbing, cleanup, etc that are not strictly necessary to achieve the goal. Any of the latter should go only into master and ride the normal stabilization schedule. Exceptions include CI/metrics changes, CLI improvements and documentation updates on a case by case basis.