This repository has been archived by the owner on Jan 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Support token-2022 in RPC instruction parsing #24537
Merged
mergify
merged 4 commits into
solana-labs:master
from
CriesofCarrots:token-2022-ix-parsers
Apr 27, 2022
Merged
Support token-2022 in RPC instruction parsing #24537
mergify
merged 4 commits into
solana-labs:master
from
CriesofCarrots:token-2022-ix-parsers
Apr 27, 2022
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
17e0f8b
to
9bb3f5d
Compare
Codecov Report
@@ Coverage Diff @@
## master #24537 +/- ##
===========================================
+ Coverage 70.0% 82.0% +11.9%
===========================================
Files 37 596 +559
Lines 2301 165453 +163152
Branches 325 0 -325
===========================================
+ Hits 1613 135806 +134193
- Misses 573 29647 +29074
+ Partials 115 0 -115 |
Here's an example of a token-2022 transaction that creates a mint with the DefaultTokenState extension (note the unparsed instruction):
|
joncinque
previously approved these changes
Apr 25, 2022
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.
Just the one question about closable mints, but otherwise the rest of this is good to go for spl-token-v3 compatibility
9bb3f5d
to
7980b1c
Compare
joncinque
previously approved these changes
Apr 26, 2022
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.
Looks good!
7980b1c
to
5f3b4a7
Compare
f10bb2f
to
6e9c61a
Compare
automerge label removed due to a CI failure |
6e9c61a
to
0d5cda3
Compare
\o/ |
jeffwashington
pushed a commit
to jeffwashington/solana
that referenced
this pull request
Jun 29, 2022
* Use token-2022 dependency in parse_token and add tests for new variants * Remove test hack * Bump spl-token-2022 and use new AuthorityType::CloseMint * Add zk-token-sdk to patch-crates.sh
mergify bot
pushed a commit
that referenced
this pull request
Aug 5, 2022
* Use token-2022 dependency in parse_token and add tests for new variants * Remove test hack * Bump spl-token-2022 and use new AuthorityType::CloseMint * Add zk-token-sdk to patch-crates.sh (cherry picked from commit a1b066a) # Conflicts: # Cargo.lock # account-decoder/Cargo.toml # client/Cargo.toml # programs/bpf/Cargo.lock # rpc/Cargo.toml # transaction-status/Cargo.toml # transaction-status/src/parse_token.rs
mergify bot
added a commit
that referenced
this pull request
Aug 5, 2022
* Support token-2022 in RPC instruction parsing (#24537) * Use token-2022 dependency in parse_token and add tests for new variants * Remove test hack * Bump spl-token-2022 and use new AuthorityType::CloseMint * Add zk-token-sdk to patch-crates.sh (cherry picked from commit a1b066a) # Conflicts: # Cargo.lock # account-decoder/Cargo.toml # client/Cargo.toml # programs/bpf/Cargo.lock # rpc/Cargo.toml # transaction-status/Cargo.toml # transaction-status/src/parse_token.rs * Fix merge conflicts Co-authored-by: Tyera Eulberg <tyera@solana.com> Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
RPC now recognizes the spl_token_2022 program id, but cannot parse all its instructions.
Summary of Changes
Following the changes in #23067, this change set uses the spl_token_2022 to parse Instructions for RPC.
Currently supports only the subset of instructions also supported by the upcoming spl_token library.
It is expected that spl_token_2022 be an exact superset of spl_token, so using
spl_token_2022::instruction::Instruction::unpack
should be correct for instructions for both token programs. However, we will add tests upstream in SPL to be certain (edit) done here: solana-labs/solana-program-library#3106Note: I considered parsing extensions in this PR, but discovered that I need the various instruction decoders made
pub
in a new spl-token-2022 release. So in the interest of moving faster, and smaller PRs, here's the basic functionality.