Skip to content

Conversation

@shubhamjr27
Copy link

This PR updates the tokens/create-token/anchor example to use Anchor Bankrun for testing, significantly reducing test execution time while preserving real-program verification. The example is also updated to fully comply with the repository’s contribution standards.

The implementation has been extended to cover the complete token creation flow, including mint initialization, associated token account creation, initial supply minting, and metadata creation via Metaplex CPI. This makes the example a more accurate and practical reference for developers.

Changes:

Testing Infrastructure
• Replaced solana-test-validator with Anchor Bankrun.
• Added a pretest script that stages the actual Metaplex Metadata program binary (mpl_token_metadata.so) as a local test fixture.
• CPI calls are executed against the real Metaplex program logic rather than mocks.

Example Functionality
• Refactored the example to perform the full token creation flow:
-Mint initialization
-Associated Token Account creation
-Initial supply minting
-Metadata creation via Metaplex CPI
• Ensures feature parity with real-world token creation workflows.

Tooling and Compliance
• Migrated from Yarn to pnpm and added pnpm-lock.yaml, per CONTRIBUTING.md.
• Applied Biome formatting and linting, including node: protocol imports.
• Resolved Rust Edition 2024 compatibility issues with mpl-token-metadata by using anchor_spl re-exports.
• All changes are scoped to tokens/create-token/anchor. No global project configuration was modified.

CI
• Added a dedicated workflow at .github/workflows/test-tokens-create-token-anchor.yml to run this example’s tests in isolation without triggering the full test suite.

Testing:

To run the example locally:
cd tokens/create-token/anchor
pnpm install
pnpm test

The pnpm test command automatically runs the pretest script, which stages the required binary fixtures before execution.

shubham.bhardwaj added 2 commits January 4, 2026 00:39
…int Parity

Upgrades the tokens/create-token/anchor example to use Bankrun for high-performance testing and ensures feature completeness by adding Associated Token Account creation and initial supply minting alongside Metadata.
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.

1 participant