Skip to content

Commit 4703812

Browse files
authored
Add LiteSVM Tests for Cross-Program Invocation Anchor program (#473)
* feat: add LiteSVM tests for cross-program invocation in Anchor * Implement tests for initializing and interacting with the lever program using LiteSVM. * Validate state changes and transaction handling for the power account. * Ensure proper serialization and deserialization of instruction data. * chore: update @solana/web3.js and add litesvm dependency in package.json * chore: update TypeScript configuration for Anchor project * Change target and module to ES2020 and nodenext respectively. * Update library to ES2020 for improved compatibility. * refactor: replace cpi.ts with test.ts for improved cross-program invocation testing * Introduce test.ts with enhanced tests for initializing and interacting with the lever program. * Include assertions to validate state changes and account information. * Remove outdated cpi.ts test file. * chore: remove deprecated dependencies and test file for bankrun * Remove outdated bankrun.test.ts file to clean up the project structure. * Delete anchor-bankrun and solana-bankrun dependencies from package.json and pnpm-lock.yaml.
1 parent 6a712e5 commit 4703812

7 files changed

Lines changed: 387 additions & 233 deletions

File tree

basics/cross-program-invocation/anchor/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,16 @@
66
},
77
"dependencies": {
88
"@coral-xyz/anchor": "0.32.1",
9-
"@solana/web3.js": "^1.95.2"
9+
"@solana/web3.js": "^1.98.4",
10+
"litesvm": "^0.4.0"
1011
},
1112
"devDependencies": {
1213
"@types/bn.js": "^5.1.0",
1314
"@types/chai": "^4.3.0",
1415
"@types/mocha": "^9.0.0",
15-
"anchor-bankrun": "^0.4.0",
1616
"chai": "^4.3.4",
1717
"mocha": "^9.0.3",
1818
"prettier": "^2.6.2",
19-
"solana-bankrun": "^0.3.0",
2019
"ts-mocha": "^10.0.0",
2120
"typescript": "^4.3.5"
2221
}

0 commit comments

Comments
 (0)