Feat/matic pol#25
Conversation
…aming - Bump version to 1.0.1 in package-lock.json. - Update CLI options to rename 'Matic' to 'Pol' for the Polygon Mainnet, while maintaining 'Matic' as a backward-compatible alias. - Adjust network currency type to include 'POL' and update related network handling logic.
…dling - Rename 'Matic' to 'Pol' for the Polygon Mainnet while keeping 'Matic' as a backward-compatible alias. - Update network currency type to include 'POL' and modify related network handling logic.
- Introduced new test suite for verifying OA v2 token registry and W3C transferable record documents on the Polygon mainnet. - Added fixtures for both document types to validate their structure and integrity. - Implemented live test capabilities with environment variable support for running against the actual Polygon mainnet.
- Bump version to 1.0.1 in package.json and package-lock.json. - Upgrade @trustvc/trustvc dependency to version 2.14.1. - Update various dependencies in package-lock.json to their latest versions for improved stability and performance.
|
Warning Review limit reached
More reviews will be available in 40 minutes and 4 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughRenames Polygon network key from "matic" to "pol" with currency label POL, updates provider wiring and CLI labels, swaps dry-run pricing to POL, bumps ChangesPolygon network rename, provider wiring, and tests
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/commands/verify.amoy.test.ts`:
- Line 14: The RUN_LIVE_TESTS flag is using loose boolean coercion (const
RUN_LIVE_TESTS = !!process.env.RUN_LIVE_TESTS) which treats the string "false"
as truthy; change the parsing to an explicit string comparison (use
process.env.RUN_LIVE_TESTS === 'true') wherever RUN_LIVE_TESTS is defined/used
(e.g., the const RUN_LIVE_TESTS in verify.amoy.test.ts and the equivalent
constant in the other test suite) so only the literal "true" enables live RPC
tests.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 4208a54f-4f8e-4ee1-98c5-85b51b9c55fa
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (10)
.gitignorepackage.jsonsrc/utils/cli-options.tssrc/utils/networks.tstests/commands/verify.amoy.test.tstests/commands/verify.pol.test.tstests/fixtures/amoy/oa-token-registry-amoy-testnet-v2.jsontests/fixtures/amoy/w3c-transferable-record-amoy-testnet.jsontests/fixtures/pol/oa-token-registry-pol-mainnet-v2.jsontests/fixtures/pol/w3c-transferable-record-pol-mainnet.json
- Updated references from 'MATIC' to 'POL' across the codebase, including README, CLI options, and network handling logic. - Adjusted environment variable names and test cases to reflect the new naming convention for the Polygon mainnet. - Ensured backward compatibility by maintaining 'MATIC' as an alias where necessary.
- Modified tests to reject OA v3 documents in batch mode with a deprecation message. - Updated individual mode tests to log errors and skip output for OA v3 documents. - Introduced a deprecation message for OA v3, effective from October 2025, to guide users towards W3C VC.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
tests/commands/verify.amoy.test.ts (1)
86-100:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winRoot cause: global env overrides are not exception-safe in routing tests.
Both suites mutate
process.env(AMOY_RPC/POL_RPC) and rely on manual cleanup after setup. If an intermediate step throws, env state leaks into subsequent tests. Usetry/finallyand restore prior values in both tests.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/commands/verify.amoy.test.ts` around lines 86 - 100, The tests mutate process.env (AMOY_RPC and POL_RPC) without exception-safe restoration, so wrap each test's environment change in a try/finally: capture the previous value (e.g., const prevAmoy = process.env.AMOY_RPC), set process.env.AMOY_RPC = customRpc before calling getSupportedNetwork/NetworkCmdName.Amoy and provider(), then in finally restore process.env.AMOY_RPC = prevAmoy (or delete if undefined); do the same for POL_RPC in the other test to ensure no env leakage between tests and make the modifications around the code that imports/uses getSupportedNetwork, NetworkCmdName, and JsonRpcProvider.tests/commands/document-store/grant-role.test.ts (1)
64-75:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winRoot cause: partial POL rename in mocked chain metadata.
Across these tests,
CHAIN_IDwas renamed topoland currency toPOL, butSUPPORTED_CHAINS[137].namestill uses'matic'. Normalize all four mocks toname: 'pol'to keep test contracts consistent with the rename objective and avoid false confidence in network mapping behavior.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/commands/document-store/grant-role.test.ts` around lines 64 - 75, The mocked chain metadata is inconsistent: SUPPORTED_CHAINS (mock) still uses name: 'matic' for chain id 137 while CHAIN_ID was renamed to 'pol' and nativeCurrency.symbol to 'POL'; update all mocked entries so the chain name for id 137 is 'pol' (not 'matic') wherever SUPPORTED_CHAINS and related mocks appear in the grant-role.test setup so the test contracts and network mapping use a consistent 'pol' identifier across SUPPORTED_CHAINS, CHAIN_ID and nativeCurrency.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@tests/commands/document-store/grant-role.test.ts`:
- Around line 64-75: The mocked chain metadata is inconsistent: SUPPORTED_CHAINS
(mock) still uses name: 'matic' for chain id 137 while CHAIN_ID was renamed to
'pol' and nativeCurrency.symbol to 'POL'; update all mocked entries so the chain
name for id 137 is 'pol' (not 'matic') wherever SUPPORTED_CHAINS and related
mocks appear in the grant-role.test setup so the test contracts and network
mapping use a consistent 'pol' identifier across SUPPORTED_CHAINS, CHAIN_ID and
nativeCurrency.
In `@tests/commands/verify.amoy.test.ts`:
- Around line 86-100: The tests mutate process.env (AMOY_RPC and POL_RPC)
without exception-safe restoration, so wrap each test's environment change in a
try/finally: capture the previous value (e.g., const prevAmoy =
process.env.AMOY_RPC), set process.env.AMOY_RPC = customRpc before calling
getSupportedNetwork/NetworkCmdName.Amoy and provider(), then in finally restore
process.env.AMOY_RPC = prevAmoy (or delete if undefined); do the same for
POL_RPC in the other test to ensure no env leakage between tests and make the
modifications around the code that imports/uses getSupportedNetwork,
NetworkCmdName, and JsonRpcProvider.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a3e90e19-985c-41f0-8600-af42f7a2228b
📒 Files selected for processing (13)
README.mdsrc/utils/cli-options.tssrc/utils/dryRun.tssrc/utils/networks.tstests/commands/document-store/grant-role.test.tstests/commands/document-store/issue.test.tstests/commands/document-store/revoke-role.test.tstests/commands/document-store/revoke.test.tstests/commands/document-store/transfer-ownership.test.tstests/commands/token-registry/deploy.test.tstests/commands/token-registry/mint.test.tstests/commands/verify.amoy.test.tstests/commands/verify.pol.test.ts
✅ Files skipped from review due to trivial changes (1)
- README.md
# [1.1.0](v1.0.1...v1.1.0) (2026-06-11) ### Features * POL network ([#25](#25)) ([3aa1233](3aa1233))
|
🎉 This PR is included in version 1.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary by CodeRabbit
New Features
Tests
Documentation
Chores