Skip to content

Conversation

@kvelkov
Copy link

@kvelkov kvelkov commented Nov 29, 2025

This PR rebases local changes onto upstream main and contains:

  • Bumped TypeScript to ^5.3.0 and added resolution for @solana/web3.js to dedupe types
  • Enabled ES2020 target and es2020.bigint lib to support native BigInt in tests
  • Fixed test imports and resolved merge conflicts in tests/addLiquidity.test.ts
  • Minor cleanup and dependency adjustments

Please review — these changes are needed so tsc and tests run cleanly with native BigInt support and consistent web3 types.

Copilot AI review requested due to automatic review settings November 29, 2025 16:12
Copy link

Copilot AI left a 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",
Copy link

Copilot AI Nov 29, 2025

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.

Suggested change
"@coral-xyz/anchor-errors": "^0.30.1",
"@coral-xyz/anchor-errors": "^0.31.1",

Copilot uses AI. Check for mistakes.
@@ -1,5 +1,6 @@
import { AccountLayout } from "@solana/spl-token";
import { ProgramTestContext } from "solana-bankrun";
import { BanksClient, ProgramTestContext } from "solana-bankrun";
Copy link

Copilot AI Nov 29, 2025

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.

Suggested change
import { BanksClient, ProgramTestContext } from "solana-bankrun";
import { ProgramTestContext } from "solana-bankrun";

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant