-
Notifications
You must be signed in to change notification settings - Fork 79
chore: bump TypeScript to ^5.3.0, enable ES2020/BigInt & fix tests #144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR upgrades the TypeScript toolchain and dependencies to enable native BigInt support in tests. It updates TypeScript from v4 to v5.3+, configures ES2020 target with BigInt library support, and bumps Anchor framework dependencies from v0.29 to v0.31. The changes include test import reorganization to fix merge conflicts and module structure improvements.
Key changes:
- TypeScript upgraded to ^5.3.0 with ES2020/BigInt support in tsconfig.json
- Anchor framework and related packages bumped to v0.31.x with @solana/web3.js pinned to 1.98.0 via resolutions
- Test imports reorganized to resolve duplicate exports (getCpAmmProgramErrorCodeHexString moved to cpAmm.ts)
Reviewed changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Updated dependency lockfile reflecting TypeScript 5.9.3, Anchor 0.31.1, @solana/spl-token 0.4.14, and removed transitive dependencies (crypto-hash, snake-case, etc.) |
| tsconfig.json | Configured ES2020 target with es2020.bigint lib for native BigInt support; added skipLibCheck; reformatted arrays |
| package.json | Updated TypeScript to ^5.3.0, @coral-xyz/anchor to ^0.31.0, @solana/web3.js to ^1.98.0; added resolutions for web3.js deduplication |
| tests/rateLimiter.test.ts | Fixed import by moving getCpAmmProgramErrorCodeHexString to separate import from ./bankrun-utils index |
| tests/addLiquidity.test.ts | Reorganized imports: moved BanksClient import up with ProgramTestContext, reordered utility imports from common.ts before bankrun-utils index |
| tests/bankrun-utils/common.ts | Removed getCpAmmProgramErrorCodeHexString function (moved to cpAmm.ts to avoid duplicate exports); added comment explaining the move |
| programs/cp-amm/src/tests/mod.rs | Added new test module extract_vectors to test module declarations |
| programs/cp-amm/src/tests/extract_vectors.rs | New Rust test file that extracts and prints reserve calculation vectors for various liquidity scenarios |
Comments suppressed due to low confidence (1)
tests/addLiquidity.test.ts:2
- Unused import BanksClient.
import { BanksClient, ProgramTestContext } from "solana-bankrun";
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
| "typescript": "^4.3.5", | ||
| "typescript": "^5.3.0", | ||
| "prettier": "^2.6.2", | ||
| "@coral-xyz/anchor-errors": "^0.30.1", |
Copilot
AI
Nov 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The @coral-xyz/anchor-errors version constraint ^0.30.1 is inconsistent with the upgraded @coral-xyz/anchor version ^0.31.0, which depends on @coral-xyz/anchor-errors@^0.31.1. While yarn's lockfile will resolve this to 0.31.1 (as seen in yarn.lock), it's better to keep the version constraint in package.json aligned with the main dependency to avoid confusion. Consider updating this to ^0.31.1.
| "@coral-xyz/anchor-errors": "^0.30.1", | |
| "@coral-xyz/anchor-errors": "^0.31.1", |
| @@ -1,5 +1,6 @@ | |||
| import { AccountLayout } from "@solana/spl-token"; | |||
| import { ProgramTestContext } from "solana-bankrun"; | |||
| import { BanksClient, ProgramTestContext } from "solana-bankrun"; | |||
Copilot
AI
Nov 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The BanksClient import is unused. It's only accessed via context.banksClient and there are no type annotations using BanksClient directly in this file. Consider removing it from the import statement.
| import { BanksClient, ProgramTestContext } from "solana-bankrun"; | |
| import { ProgramTestContext } from "solana-bankrun"; |
This PR rebases local changes onto upstream main and contains:
Please review — these changes are needed so tsc and tests run cleanly with native BigInt support and consistent web3 types.