Skip to content

Conversation

@Ansonhkg
Copy link
Collaborator

@Ansonhkg Ansonhkg commented Aug 8, 2025

WHAT

  • Add optional custom RPC URL override for E2E & Artillery tests via LIT_YELLOWSTONE_PRIVATE_RPC_URL
image

- Introduced `getFreshPriceFeedInfo` method to fetch price feed data independently of state refresh across various network environments (naga-dev, naga-local, naga-staging, naga-test).
- Updated multi-endpoint processor to utilize the new `LitClientType` for better type safety.
- Enhanced the `createLitClient` function to include a fresh price feed info fetcher.
- Modified `fundAccount` and `getViemPublicClient` functions to utilize a custom RPC URL if provided, enhancing flexibility in network configurations.
- Cleaned up commented-out code in `runPkpSignTest` for clarity.
@Ansonhkg Ansonhkg requested a review from Copilot August 8, 2025 18:02
Copy link
Contributor

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 adds optional custom RPC URL override functionality for E2E and Artillery tests via the LIT_YELLOWSTONE_PRIVATE_RPC_URL environment variable. This allows tests to use a private RPC endpoint instead of the default public endpoints when the environment variable is set.

Key changes include:

  • Added getFreshPriceFeedInfo method to all Naga network environment modules
  • Modified E2E test helpers to support custom RPC URL override via environment variable
  • Updated Artillery test configuration to include LitClientType import

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/networks/src/networks/vNaga/envs//naga-.module.ts Added getFreshPriceFeedInfo method to expose fresh price feed fetching functionality
packages/lit-client/src/lib/LitClient/createLitClient.ts Exposed getFreshPriceFeedInfo method in the Lit client interface
e2e/src/helper/fundAccount.ts Added support for custom RPC URL via LIT_YELLOWSTONE_PRIVATE_RPC_URL environment variable
e2e/src/helper/NetworkManager.ts Added custom RPC URL support for Viem public client creation
e2e/artillery/src/processors/multi-endpoints.ts Updated imports and type annotations for Artillery tests


// Global variables to cache expensive operations
let litClient: any = null;
let litClient: LitClientType;
Copy link

Copilot AI Aug 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The litClient variable is declared without initialization but used in conditional checks. This will cause a TypeScript error since LitClientType doesn't include undefined. Consider initializing as let litClient: LitClientType | null = null; to match the previous pattern.

Suggested change
let litClient: LitClientType;
let litClient: LitClientType | null = null;

Copilot uses AI. Check for mistakes.
authContext: authContext,
pubKey: state.masterAccount.pkp.publicKey,
toSign: `Hello from Artillery! ${Date.now()}`, // Unique message per request
// userMaxPrice: 1000000000000000000n,
Copy link

Copilot AI Aug 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commented-out code appears to be debugging code that should be removed before merging to keep the codebase clean.

Suggested change
// userMaxPrice: 1000000000000000000n,

Copilot uses AI. Check for mistakes.
@Ansonhkg Ansonhkg merged commit dc33e85 into feat/naga-dev-29-05-2025-v2 Aug 11, 2025
3 checks passed
@Ansonhkg Ansonhkg deleted the feature/jss-32-naga-sdk-add-rpc-env-var-for-e2e-and-artillery-tests branch August 11, 2025 17:31
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.

2 participants