Skip to content

Commit 6a712e5

Browse files
authored
Add LiteSVM Tests for Favorites Anchor program (#474)
* feat: add LiteSVM tests for favorites anchor program - Implement tests for writing, updating, and validating favorite data on the blockchain. - Ensure unauthorized transactions are rejected correctly. - Utilize LiteSVM for transaction simulation and account state verification. * chore: update dependencies in anchor package.json and pnpm-lock.yaml - Upgrade @solana/web3.js from ^1.95.2 to ^1.98.4. - Add litesvm dependency with version ^0.4.0. - Update lockfile to reflect changes in dependencies and their versions. * chore: update TypeScript configuration for anchor package - Change target and module to es2020 and nodenext respectively. - Update lib to include es2020 for improved compatibility. * refactor: improve favorites test structure and error handling - Update test descriptions for clarity. - Replace deprecated error handling with assertions for unauthorized signer checks. - Simplify transaction execution and data validation for favorites. - Ensure consistent usage of BN for big number handling. * chore: rename the filename for consistency and update test script * chore: remove deprecated bankrun and related stuff - Delete @solana-developers/helpers and related references from package.json and pnpm-lock.yaml. - Remove favorites-bankrun.test.ts and system-errors.ts files as they are no longer needed. - Clean up the project structure by eliminating obsolete code and dependencies.
1 parent 024e8a0 commit 6a712e5

9 files changed

Lines changed: 384 additions & 359 deletions

File tree

basics/favorites/anchor/Anchor.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ cluster = "Localnet"
1515
wallet = "~/.config/solana/id.json"
1616

1717
[scripts]
18-
test = "pnpm ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.test.ts"
18+
test = "pnpm ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"

basics/favorites/anchor/package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,17 @@
66
},
77
"dependencies": {
88
"@coral-xyz/anchor": "0.32.1",
9-
"@solana-developers/helpers": "^2.0.0",
10-
"@solana/web3.js": "^1.95.2"
9+
"@solana/web3.js": "^1.98.4",
10+
"litesvm": "^0.4.0"
1111
},
1212
"license": "MIT",
1313
"devDependencies": {
1414
"@types/bn.js": "^5.1.0",
1515
"@types/chai": "^4.3.0",
1616
"@types/mocha": "^9.0.0",
17-
"anchor-bankrun": "^0.4.0",
1817
"chai": "^4.3.4",
1918
"mocha": "^9.0.3",
2019
"prettier": "^2.6.2",
21-
"solana-bankrun": "^0.3.0",
2220
"ts-mocha": "^10.0.0",
2321
"typescript": "^4.3.5"
2422
}

0 commit comments

Comments
 (0)