Skip to content

Commit 8fe00ed

Browse files
committed
Migrate to Anchor 1.0, Rust LiteSVM tests with solana-kite 0.3.0
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
1 parent 85aa223 commit 8fe00ed

706 files changed

Lines changed: 21872 additions & 17118 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/anchor.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ on:
66
push:
77
branches:
88
- main
9+
- anchor-1.0-final
910
- anchor-1.0
11+
- fix-biome-errors
1012
pull_request:
1113
types: [opened, synchronize, reopened]
1214
branches:

.github/workflows/rust.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ on:
99
push:
1010
branches:
1111
- main
12+
- anchor-1.0-final
1213
- anchor-1.0
14+
- fix-biome-errors
1315
pull_request:
1416
types: [opened, synchronize, reopened]
1517
branches:

.github/workflows/solana-native.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
push:
77
branches:
88
- main
9+
- anchor-1.0-final
10+
- fix-biome-errors
911
pull_request:
1012
types: [opened, synchronize, reopened]
1113
branches:
@@ -107,6 +109,7 @@ jobs:
107109
failed_projects: ${{ steps.set-failed.outputs.failed_projects }}
108110
steps:
109111
- uses: actions/checkout@v5
112+
- uses: pnpm/action-setup@v4
110113
- name: Use Node.js
111114
uses: actions/setup-node@v5
112115
with:
@@ -192,8 +195,7 @@ jobs:
192195
# Make the script executable
193196
chmod +x build_and_test.sh
194197
195-
# Install pnpm
196-
npm install --global pnpm
198+
# pnpm is already installed via pnpm/action-setup
197199
- name: Setup Solana Stable
198200
uses: heyAyushh/setup-solana@v5.9
199201
with:

.github/workflows/solana-pinocchio.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
push:
77
branches:
88
- main
9+
- anchor-1.0-final
10+
- fix-biome-errors
911
pull_request:
1012
types: [opened, synchronize, reopened]
1113
branches:
@@ -107,6 +109,7 @@ jobs:
107109
failed_projects: ${{ steps.set-failed.outputs.failed_projects }}
108110
steps:
109111
- uses: actions/checkout@v5
112+
- uses: pnpm/action-setup@v4
110113
- name: Use Node.js
111114
uses: actions/setup-node@v5
112115
with:
@@ -192,8 +195,7 @@ jobs:
192195
# Make the script executable
193196
chmod +x build_and_test.sh
194197
195-
# Install pnpm
196-
npm install --global pnpm
198+
# pnpm is already installed via pnpm/action-setup
197199
- name: Setup Solana Stable
198200
uses: heyAyushh/setup-solana@v5.9
199201
with:

.github/workflows/typescript.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: TypeScript
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- anchor-1.0-final
8+
- fix-biome-errors
9+
pull_request:
10+
types: [opened, synchronize, reopened]
11+
branches:
12+
- main
13+
14+
env:
15+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
16+
17+
jobs:
18+
biome:
19+
name: Biome check
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v5
23+
- uses: pnpm/action-setup@v4
24+
- uses: actions/setup-node@v4
25+
with:
26+
node-version: 20
27+
cache: pnpm
28+
# --frozen-lockfile: fail if pnpm-lock.yaml is out of date
29+
# --ignore-workspace: only install root deps, not all 94 subprojects
30+
- run: pnpm install --frozen-lockfile --ignore-workspace
31+
- run: pnpm run check

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ node_modules/
1414
**/*/.anchor
1515
**/*/.DS_Store
1616
**/*/target
17-
**/*/tests/fixtures
17+
# Ignore test fixtures by default, but allow .so program binaries needed for LiteSVM tests
18+
**/*/tests/fixtures/*
19+
!**/*/tests/fixtures/*.so
1820
**/*.rs.bk
1921
**/*/test-ledger
2022
**/*/yarn.lock

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"editor.defaultFormatter": "biomejs.biome",
3+
"editor.formatOnSave": true
4+
}

0 commit comments

Comments
 (0)