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
Open
Conversation
de8bb1e to
4f89e09
Compare
35dd788 to
0ed4f4c
Compare
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
0ed4f4c to
8fe00ed
Compare
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? |
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
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)
@coral-xyz/anchor→@anchor-lang/corein TypeScriptCpiContext::new().to_account_info()→.key()in Rust.map_err()wrappers for SPL 2.x→3.x ProgramError bridgeBox<InterfaceAccount>for stack overflowinvoke()(no Solana 3.x release)Rust LiteSVM tests
Repo cleanup
691 files changed, +21,837 / -17,091