Skip to content

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

Open
mikemaccana-edwardbot wants to merge 1 commit intosolana-developers:mainfrom
mikemaccana:anchor-1.0-final
Open

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 1 commit intosolana-developers:mainfrom
mikemaccana: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. 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.

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

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

  • 46 Anchor programs now have Rust integration tests (~6,800 lines total)
  • Common test operations (account creation, token minting, PDA derivation, balance checks) use solana-kite 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-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?

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.

3 participants