-
Notifications
You must be signed in to change notification settings - Fork 90
refactor: ctoken sdk #2100
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
Merged
Merged
refactor: ctoken sdk #2100
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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
File renamed without changes.
This file contains hidden or 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
File renamed without changes.
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,11 @@ | ||
| //! Compressed token account types and instruction builders. | ||
|
|
||
| #[cfg(feature = "v1")] | ||
| mod v1; | ||
| mod v2; | ||
|
|
||
| pub mod ctoken_instruction; | ||
|
|
||
| // Re-export everything from v1 and v2 | ||
| #[cfg(feature = "v1")] | ||
| pub use v1::*; | ||
| pub use v2::*; |
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| pub mod claim; | ||
| //! Compressible token utilities for runtime decompression. | ||
|
|
||
| #[cfg(feature = "compressible")] | ||
| pub mod decompress_runtime; | ||
| pub mod withdraw_funding_pool; | ||
|
|
||
| pub use claim::*; | ||
| #[cfg(feature = "compressible")] | ||
| pub use decompress_runtime::{process_decompress_tokens_runtime, CTokenSeedProvider}; | ||
| pub use withdraw_funding_pool::*; |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
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.
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.
Behavior is correct, but error names still reference the old token pool abstraction
The refactor from token pool to SPL interface in this builder looks solid:
SplInterface<'info>now carriesspl_interface_pdaandspl_interface_pda_bump.with_spl_interfaceenforces presence of mint, SPL token program, SPL interface PDA, and bump before enabling SPL↔ctoken transfers.invoke/invoke_signedbranches correctly plumbspl_interface_pdaand its bump intoTransferCtokenToSplAccountInfosandTransferSplToCtokenAccountInfos.One small inconsistency is that
with_spl_interfacestill uses:for the SPL interface PDA and bump. Given the rest of the file and the new
SplInterfaceRequirederror are framed in terms of “SPL interface”, these legacy variant names (and likely their user-facing messages) will be confusing.If you can afford it in this PR, I’d suggest:
MissingSplInterfacePda/MissingSplInterfacePdaBump(with a deprecation alias if needed), orThat keeps the error surface aligned with the new abstraction and makes debugging much clearer.
Also applies to: 56-87, 99-151, 163-221
🤖 Prompt for AI Agents