Skip to content

Use spl-token-2022-interface instead of spl-token-2022 - #167

Merged
joncinque merged 1 commit into
solana-program:mainfrom
clankmaxxing-clod:token-2022-interface
Nov 21, 2026
Merged

joncinque merged 1 commit into
solana-program:mainfrom
clankmaxxing-clod:token-2022-interface

Conversation

@clankmaxxing-clod

Copy link
Copy Markdown
Contributor

Problem

The program depends on the full spl-token-2022 program crate, but only uses StateWithExtensions and Mint. Bumping to v12 also breaks the tests, since its pinocchio-based processor can't be registered with processor!.

Summary of changes

  • Replace spl-token-2022 with spl-token-2022-interface v4.0.0, and update the imports and id() calls to match
  • In tests, remove the add_program call for Token-2022 and the prefer_bpf(false) line, since solana-program-test provides Token-2022 by default

spl-token-2022 stays in Cargo.lock only as a transitive dev-dependency through spl-token-client.

Checked locally: make format-check-program, make clippy-program, make build-sbf-program && make test-program all pass.

🤖 Generated with Claude Code

The program only needs Token-2022 types, so depend on the interface crate
instead of the full program crate. In tests, solana-program-test provides
Token-2022 by default, so stop adding it as a program.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@joncinque
joncinque merged commit b672a52 into solana-program:main Nov 21, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants