Skip to content

Use Rust and LiteSVM for tests per new Anchor defaults, migrate from 1.0rc5 to Anchor 1.0 final#555

Closed
mikemaccana-edwardbot wants to merge 7 commits intosolana-developers:mainfrom
quiknode-labs:anchor-1.0-final
Closed

Use Rust and LiteSVM for tests per new Anchor defaults, migrate from 1.0rc5 to Anchor 1.0 final#555
mikemaccana-edwardbot wants to merge 7 commits intosolana-developers:mainfrom
quiknode-labs:anchor-1.0-final

Conversation

@mikemaccana-edwardbot
Copy link
Copy Markdown
Contributor

@mikemaccana-edwardbot mikemaccana-edwardbot commented Apr 7, 2026

Summary

Replaces all TypeScript Anchor tests with Rust LiteSVM tests. No more per-project npm dependencies for Anchor tests.

All CI passing on fork: GitHub Actions (anchor-1.0-final)

Anchor 1.0.0 (stable)

  • Migrate all Anchor programs from 1.0.0-rc5 → 1.0.0 (stable, released 2026-04-02)

Rust LiteSVM tests

  • All Anchor programs now have Rust integration tests using solana-kite helpers
  • The compression projects (cutils, cnft-burn, cnft-vault) and nft-meta-data-pointer retain TypeScript tests — they depend on Metaplex Bubblegum and the account compression BPF programs, which require a full validator rather than LiteSVM

Repo cleanup

  • Configure biome, fix all lint errors
  • Remove yarn.lock (project uses pnpm)
  • Add pnpm/action-setup to CI workflows
  • Upgrade litesvm to 0.11.0
  • Use 🤥 emoji for Pinocchio (lying face / growing nose)

@mikemaccana-edwardbot mikemaccana-edwardbot changed the title Migrate to Anchor 1.0, Rust LiteSVM tests, and solana-kite 0.3.0 Use Rust and LiteSVM for tests per new Anchor defaults, migrated from 1.0rc5 to Anchor 1.0 final Apr 7, 2026
@mikemaccana-edwardbot mikemaccana-edwardbot changed the title Use Rust and LiteSVM for tests per new Anchor defaults, migrated from 1.0rc5 to Anchor 1.0 final Use Rust and LiteSVM for tests per new Anchor defaults, migrate from 1.0rc5 to Anchor 1.0 final Apr 7, 2026
@mikemaccana-edwardbot mikemaccana-edwardbot force-pushed the anchor-1.0-final branch 2 times, most recently from 35dd788 to 0ed4f4c Compare April 7, 2026 01:44
Replaces all TypeScript Anchor tests with Rust LiteSVM tests powered by
solana-kite (https://crates.io/crates/solana-kite). Kite consolidates
repeated test boilerplate — account creation, token minting, PDA derivation,
balance assertions — into reusable functions. The result: 46 Rust test files
averaging just 148 lines each, replacing ~13,700 lines of TypeScript tests
and 109 per-project config files (package.json, tsconfig, pnpm-lock.yaml).
No more per-project npm dependencies for Anchor tests.

### Anchor 1.0.0 (stable)
- Migrate all 49 Anchor programs from 0.32.1 → 1.0.0 (stable, released 2026-04-02)
- @coral-xyz/anchor → @anchor-lang/core in TypeScript
- CpiContext::new() .to_account_info() → .key() in Rust
- Transfer-hook: .map_err() wrappers for SPL 2.x→3.x ProgramError bridge
- transfer-cost: upgraded SPL crates to Solana 3.x, Box<InterfaceAccount> for stack overflow
- Compression: replaced mpl-bubblegum CPI with raw invoke() (no Solana 3.x release)

### Rust LiteSVM tests with solana-kite 0.3.0
- 46 Anchor programs now have Rust integration tests (~6,800 lines total)
- solana-kite replaces hundreds of lines of duplicated setup code per test:
  create_funded_keypair, create_token_mint, mint_tokens_to_token_account,
  get_pda, get_token_balance — all one-liners instead of 20+ line helpers
- Eliminates 109 per-project boilerplate files (package.json, tsconfig, pnpm-lock)
- Net deletion: ~6,900 lines of TypeScript test code removed

### Repo cleanup
- Configure biome, fix all lint errors
- Remove yarn.lock (project uses pnpm)
- Add pnpm/action-setup to CI workflows
- Upgrade litesvm from 0.8.1 to 0.11.0
- Use 🤥 emoji for Pinocchio (lying face / growing nose)

691 files changed, +21,837 / -17,091
@mikemaccana
Copy link
Copy Markdown
Contributor

@Perelyn-sama this is a follow-up to my previous RC5 now the final version of Anchor has been released, more significantly though it also uses LiteSVM by default as Anchor 1.0 does - could you please check it out?

Edward added 5 commits April 8, 2026 16:19
Program IDs should match what's on main. These were changed
unnecessarily during the LiteSVM migration.
Projects with Rust LiteSVM tests no longer need their old TypeScript
test files, package.json, tsconfig.json, or pnpm-lock.yaml.
@Perelyn-sama
Copy link
Copy Markdown
Collaborator

@Perelyn-sama this is a follow-up to my previous RC5 now the final version of Anchor has been released, more significantly though it also uses LiteSVM by default as Anchor 1.0 does - could you please check it out?

Hey @mikemaccana, thanks for another PR. This looks great, I like that we’re adding more Rust tests but I don’t think we need to remove the TypeScript tests yet. It would also be nice to reduce the size of PRs and focus on one task at a time so reviews can move more smoothly.

The hand test loads lever.so (a different program) via include_bytes!(),
which fails during anchor build's IDL generation step because the .so
files don't exist yet at compile time. Using std::fs::read() defers the
load to test runtime, after anchor build has created the artifacts.
@mikemaccana
Copy link
Copy Markdown
Contributor

@Perelyn-sama No probs, I'll rebase and split this up into smaller PRs for easier review - will close this and open the smaller ones now 👍

@mikemaccana-edwardbot
Copy link
Copy Markdown
Contributor Author

Closing in favour of smaller, focused PRs (repo cleanup, Anchor 1.0 migration, and LiteSVM tests as separate branches).

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.

4 participants