-
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
Add account-decoder utilities #10846
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CriesofCarrots
force-pushed
the
parse-accounts
branch
from
June 30, 2020 07:04
dca7f92
to
9de8a8b
Compare
Codecov Report
@@ Coverage Diff @@
## master #10846 +/- ##
=========================================
- Coverage 81.8% 81.8% -0.1%
=========================================
Files 303 307 +4
Lines 71067 71233 +166
=========================================
+ Hits 58194 58324 +130
- Misses 12873 12909 +36 |
Thanks for general refactoring! FYI, there is slight demand for general account printing coming from |
mvines
reviewed
Jun 30, 2020
CriesofCarrots
force-pushed
the
parse-accounts
branch
from
June 30, 2020 22:15
9de8a8b
to
3c5a957
Compare
mvines
previously approved these changes
Jul 1, 2020
CriesofCarrots
added
the
automerge
Merge this Pull Request automatically once CI passes
label
Jul 1, 2020
CriesofCarrots
added a commit
to CriesofCarrots/solana
that referenced
this pull request
Jul 7, 2020
* Fix comment and make less pub * Add account-decoder crate and use to decode vote and system (nonce) accounts * Update docs * Rename RpcAccount struct * s/Rpc/Display * Call it jsonParsed and update docs * Revert "s/Rpc/Display" This reverts commit 6e7149f. * s/Rpc/Ui * Add tests * Ui more things * Comments
CriesofCarrots
added a commit
to CriesofCarrots/solana
that referenced
this pull request
Jul 7, 2020
* Fix comment and make less pub * Add account-decoder crate and use to decode vote and system (nonce) accounts * Update docs * Rename RpcAccount struct * s/Rpc/Display * Call it jsonParsed and update docs * Revert "s/Rpc/Display" This reverts commit 6e7149f. * s/Rpc/Ui * Add tests * Ui more things * Comments
CriesofCarrots
added a commit
that referenced
this pull request
Jul 7, 2020
* Revert "Rpc: add filter to getProgramAccounts (#10888) (#10932)" This reverts commit 9311a6e. * Add jsonParsed option for EncodedTransactions; add memo parser (#10711) * Add jsonParsed option for EncodedTransactions; add memo parser * Use kebab case for program names * Add account-key parsing * Add parse test * Update transaction encoding docs (#10833) * Add account-decoder utilities (#10846) * Fix comment and make less pub * Add account-decoder crate and use to decode vote and system (nonce) accounts * Update docs * Rename RpcAccount struct * s/Rpc/Display * Call it jsonParsed and update docs * Revert "s/Rpc/Display" This reverts commit 6e7149f. * s/Rpc/Ui * Add tests * Ui more things * Comments * Update struct prefixes to Ui (#10874) * Update comments * Use Ui prefix * Rpc: add filter to getProgramAccounts (#10888) * Add RpcFilterType, and implement CompareBytes for getProgramAccounts * Accept bytes in bs58 * Rename to memcmp * Add Memcmp optional encoding field * Add dataSize filter * Update docs * Clippy * Simplify tests that don't need to test account contents; add multiple-filter tests
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Currently, inspecting an on-chain account requires depending on a client-side, language-specific decoding library to parse the account data. If rpc methods could return decoded account data, these custom solutions would be unnecessary.
Summary of Changes
There are a lot of similarities between what this crate does and what
solana-transaction-status
. Combining and renaming should be considered in the future.getAccountInfo
andgetProgramAccounts
rpcs.Currently, client behavior remains the same; deduplication in rpc_client/cli/web3.js = follow-up work.
Toward #10475
Remaining work on that issue is parsing SPL Token accounts, which is blocked on publishing spl-token to crates.io.