Conversation
|
Packages published to prioritise usability of the naga-dev network: |
|
|
There was a problem hiding this comment.
Pull Request Overview
This is the main naga branch that introduces a comprehensive set of changes across the Lit Protocol JavaScript SDK, including the creation of a new Artillery testing package, significant refactoring of access control conditions with the introduction of new schema-based validation, and removal of wrapped-keys testing files. The PR represents a major restructuring with the addition of comprehensive load testing capabilities and modernized access control condition handling.
Key changes:
- Added a new Artillery package for load testing with various test configurations
- Introduced access-control-conditions-schemas package with Zod-based validation
- Completely refactored access-control-conditions package with new validator, builder pattern, and improved type safety
- Removed all wrapped-keys related test files from local-tests
Reviewed Changes
Copilot reviewed 223 out of 1442 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/artillery/* | New Artillery load testing package with configurations and metadata |
| packages/access-control-conditions-schemas/* | New schema validation package using Zod for access control conditions |
| packages/access-control-conditions/src/lib/* | Complete refactor with new validation, builder pattern, and modernized utilities |
| local-tests/tests/wrapped-keys/* | Removal of all wrapped-keys test files |
| nx.json, package.json | Updated project configuration and dependencies |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| }); | ||
| } catch (e) { | ||
| console.log(`Failed to get decimals for ${acc.contractAddress}`); | ||
| logger.info(`Failed to get decimals for ${acc.contractAddress}`); // is this safe to fail and continue? |
There was a problem hiding this comment.
The inline comment raises a valid concern about error handling safety. Consider documenting the expected behavior when decimal retrieval fails or implementing proper error handling rather than just logging and continuing.
| logger.info(`Failed to get decimals for ${acc.contractAddress}`); // is this safe to fail and continue? | |
| logger.warn(`Failed to get decimals for ${acc.contractAddress}, using default of 18. Error: ${e}`); | |
| decimals = 18; // Default to 18 decimals if retrieval fails |
| ): Promise<string> => { | ||
| const hashed = await hashResourceId(resourceId); | ||
| return uint8arrayToString(new Uint8Array(hashed), 'base16'); | ||
| return Buffer.from(new Uint8Array(hashed)).toString('hex'); |
There was a problem hiding this comment.
The conversion from ArrayBuffer to Uint8Array to Buffer to hex string could be simplified to Buffer.from(hashed).toString('hex') since Buffer.from() can directly accept ArrayBuffer.
| return Buffer.from(new Uint8Array(hashed)).toString('hex'); | |
| return Buffer.from(hashed).toString('hex'); |
| path, | ||
| returnValueTest: { | ||
| key, | ||
| comparator: comparator || ('=' as any), |
There was a problem hiding this comment.
Using as any to bypass type checking should be avoided. Instead, define the proper type or use a type assertion that's more specific to the expected type.
| comparator: comparator || ('=' as any), | |
| comparator: comparator || '=', |
| method, | ||
| parameters, | ||
| returnValueTest: { | ||
| comparator: comparator || ('=' as any), |
There was a problem hiding this comment.
Another instance of using as any to bypass type checking. This pattern appears multiple times and should be replaced with proper typing.
| comparator: comparator || ('=' as any), | |
| comparator: comparator || '=', |
chore(contracts): update naga-test abi and addresses
chore(release): version packages
Signed-off-by: Anson <ansonox@gmail.com>
…ion-authsig Feat/naga capacity delegation authsig
chore(release): version packages
fix(wasm): add module param to initialization
chore(release): version packages
…-mainnet-being-live some updates around mainnet being live
WHAT
This is the main naga branch 🌶️
Getting started