test(tokens): migrate 5 Metaplex/token native examples to mpl 5.x + LiteSVM and re-enable in CI#54
Merged
Conversation
… test create-token/native was excluded (devnet-only TypeScript test). Its program also no longer compiled: the code used the old `mpl_token_metadata::instruction` API while the dep had been bumped to 5.1.1. - Migrate to the mpl-token-metadata 5.x instruction builders (CreateMetadataAccountV3), solana-system-interface for the system program, and spl-token-interface for the Mint. mpl 5.x rides an older solana-program, so a small bridge converts its returned Instruction to this program's type. - Add a LiteSVM test that loads the program plus the Token-Metadata program (from a committed mpl_token_metadata.so fixture, since LiteSVM does not bundle it) and asserts the mint and metadata accounts are created. - Add the program to the workspace, remove the devnet TS test/tooling, rewire build-and-test to build the fixture the LiteSVM cargo test consumes, and drop create-token/native from .github/.ghaignore.
…mint-authority natives to mpl 5.x + LiteSVM Migrate the four Metaplex-using native token examples off the old mpl-token-metadata 1.x / system_instruction / spl-token APIs onto the current toolchain, matching the create-token reference: - mpl-token-metadata 5.x builders (CreateMetadataAccountV3, CreateMasterEditionV3) bridged from the older solana-program types the builders return via a shared bridge.rs (to_mpl / bridge_instruction). - solana-system-interface for create_account. - spl-token-interface + spl-associated-token-account-interface 2.0.0. - transfer-tokens now uses transfer_checked (reads mint decimals). - Add each crate to the root workspace members and remove from .ghaignore. - Add LiteSVM Rust tests (program/tests/test.rs) loading the program plus the committed mpl_token_metadata.so fixture, exercising create/mint/ transfer/master-edition/PDA-authority flows end to end with assertions. - Replace package.json with scripts-only, delete devnet TS tests + tsconfig, regenerate empty pnpm lockfiles. https://claude.ai/code/session_013dpnF6uSGWXjkJJZseqzcP
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.
Summary
Re-enables the five Metaplex/SPL-token native examples that were excluded in
.github/.ghaignoreas "can't test on localnet". They weren't just untestable — their programs no longer compiled: the code used the oldmpl_token_metadata::instruction::*API while the dep had been bumped tompl-token-metadata 5.1.1, and several pinned stalesolana-program/spl-token/spl-associated-token-accountversions. So each needed a real migration plus a LiteSVM test.Per example
transfer→transfer_checked.)invoke_signed. Asserts the PDA-owned mint + master edition.Migration pattern (consistent across all five)
instruction::create_metadata_accounts_v3/create_master_edition_v3→ the mpl 5.x builders (instructions::CreateMetadataAccountV3/CreateMasterEditionV3,types::DataV2).solana-program, so a small sharedbridge(to_mpl/bridge_instruction, via an aliasedmpl-solana-programdep) converts its returnedInstruction/Pubkeyto each program's types.solana_program::system_instruction→solana-system-interface; SPL token/ATA → thespl-token-interface/spl-associated-token-account-interfacecrates.mpl_token_metadata.sofixture per example (LiteSVM doesn't bundle Token-Metadata); addedprogram/tests/test.rs; replaced the devnet TypeScript tests with scripts-onlypackage.json(build-and-testbuilds the.sothe LiteSVMcargo testconsumes); and removed all five from.github/.ghaignore.Verification
All built (
cargo build-sbf) and run against the CI toolchain (Solana 3.1.14 / platform-tools v1.52): the 5 LiteSVM integration tests pass, whole-workspacecargo fmt --checkis clean, andcargo clippy --tests -- -D warningsis clean for all five. Onlympl_token_metadata.sois committed in each fixtures dir — the program.sofiles are built by CI.https://claude.ai/code/session_013dpnF6uSGWXjkJJZseqzcP
Generated by Claude Code