Repository navigation
Fix decode_set_authority rejecting Token-2022 authority types - #718
Open
Amadeus-22 wants to merge 1 commit into
Open
Amadeus-22 wants to merge 1 commit into
Amadeus-22 wants to merge 1 commit into
Conversation
AuthorityType stopped at CLOSE_ACCOUNT (3), so decode_set_authority() raised ValueError on any Token-2022 SetAuthority instruction for an extension authority, and set_authority() could not build one. The transfer fee authorities set by initialize_transfer_fee_config() could not be rotated or revoked. Add the Token-2022 authority types 4-17, matching the token-2022 interface crate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #718 +/- ##
==========================================
+ Coverage 95.41% 95.47% +0.06%
==========================================
Files 25 25
Lines 1918 1946 +28
==========================================
+ Hits 1830 1858 +28
Misses 88 88 🚀 New features to boost your workflow:
|
Contributor
Author
|
The macOS 3.11 failure is a flaky websocket integration test (test_logs_subscribe_filter_all, connection reset), unrelated to this change; the other jobs pass. Could you re-run it? |
Collaborator
|
looks good |
This branch has not been deployed
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
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.
AuthorityTypestopped atCLOSE_ACCOUNT(3), but Token-2022 defines authority types up to 17. As a result:decode_set_authority()raisedValueError: 4 is not a valid AuthorityTypeon any Token-2022SetAuthorityfor an extension authority, such asTransferFeeConfig.set_authority()couldn't build one, becauseSetAuthorityParamsrejects the value.initialize_transfer_fee_config()could not be rotated or revoked.This adds authority types 4–17, matching
AuthorityTypein the token-2022 interface crate (interface/src/instruction.rs). The new test decodes a raw Token-2022SetAuthority([6, 4, 1] + pubkey) and round-trips aWithheldWithdrawrevoke. It fails on master and passes with this change. Unit tests: 144 passed;ruff checkandruff format --checkclean.🤖 Generated with Claude Code