-
Notifications
You must be signed in to change notification settings - Fork 88
Feature/jss 132 naga test allow naga local configuration #961
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
Feature/jss 132 naga test allow naga local configuration #961
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 adds local configuration support for the Naga network by introducing a withLocalContext helper method that allows loading custom network signatures from local JSON files.
- Exposed a minimal
withLocalContexthelper that accepts network context configuration options - Updated the e2e initialization to conditionally use
withLocalContextwhenNAGA_LOCAL_CONTEXT_PATHenvironment variable is available - Refactored the naga-local module to support dynamic signature loading and configuration overrides
Reviewed Changes
Copilot reviewed 8 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/wasm/package.json | Updated build scripts to use pnpm instead of yarn |
| packages/networks/src/networks/vNaga/index.ts | Added export for NagaLocalContextOptions type |
| packages/networks/src/networks/vNaga/envs/naga-local/naga-local.module.ts | Major refactor to support dynamic configuration with withLocalContext method |
| packages/networks/src/networks/vNaga/envs/naga-local/naga-local.env.ts | Updated constructor to accept custom signatures parameter |
| packages/networks/src/networks/vNaga/envs/naga-local/index.ts | Added export for new types |
| packages/e2e/src/init.ts | Added conditional logic to use withLocalContext when environment variables are set |
| packages/contracts/src/custom-network-signatures.ts | Extracted buildSignaturesFromContext function for runtime signature building |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
packages/networks/src/networks/vNaga/envs/naga-local/naga-local.module.ts
Outdated
Show resolved
Hide resolved
|
…`createEnvVars` utils
…contexts and improve code structure
…onfiguration Signed-off-by: Anson <[email protected]>
…n' of https://github.com/LIT-Protocol/js-sdk into feature/jss-132-naga-test-allow-naga-local-configuration
…s-132-naga-test-allow-naga-local-configuration
WHAT
withLocalContexthelper.withLocalContextwhenNAGA_LOCAL_CONTEXT_PATH(and optional name) are providedcreateShivaClientto@lit-protocol/e2eso QA can control Shiva-managed testnets and assert epoch changes through a Lit clientmaxPricenow is being sent as hex instead of decimal the node deserialises viaserde_jsonintoethers::types::U256, which treats bare strings as hex. Sending our decimal bigint (e.g. "250000000000000000") therefore turns into the much larger 0x2500... amount.minorchangesetUsage
Shiva APIs
inspectEpoch()- snapshot the Lit client context (chain epoch, per-node epochs, threshold, connected count, latest blockhash).waitForEpochChange({ baselineEpoch, timeoutMs?, intervalMs? })- poll until the epoch advances beyond the baseline (defaults: 60s timeout, 2s interval).transitionEpochAndWait()- trigger/test/action/transition/epoch/wait/<id>to advance the epoch and wait for completion.stopRandomNodeAndWait()- invoke/test/action/stop/random/wait/<id>to drop a random node and wait for the next epoch.pollTestnetState()- fetch/test/poll/testnet/<id>for the current Shiva state (Busy,Active, etc.).getTestnetInfo()- return/test/get/info/testnet/<id>payload (contracts, RPC URL, epoch config).deleteTestnet()- call/test/delete/testnet/<id>to shut down the managed testnet.baseUrl/testnetId– exposed properties for logging and reuse.Snapshots published
Test
Created a QA starter kit for this:
https://github.com/LIT-Protocol/QA-kit