Skip to content

Feat/matic pol exploer update#148

Closed
manishdex25 wants to merge 13 commits into
mainfrom
feat/matic-pol-exploer-update
Closed

Feat/matic pol exploer update#148
manishdex25 wants to merge 13 commits into
mainfrom
feat/matic-pol-exploer-update

Conversation

@manishdex25

@manishdex25 manishdex25 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

What is the background of this pull request?

Changes

  • What are the changes made in this pull request?
  • Change this and that, etc...

Issues

What are the related issues or stories?

Summary by CodeRabbit

Release Notes

  • New Features

    • Added support for Polygon (POL) mainnet network.
    • Added support for Polygon Amoy testnet with updated explorer endpoints.
  • Chores

    • Bumped version to 2.14.0.
    • Updated @tradetrust-tt/tt-verify dependency to latest patch version.
    • Enhanced test coverage for newly supported networks.

manishdex25 and others added 13 commits June 4, 2026 15:41
This change enhances clarity and consistency in network handling.
- Added new fixtures for W3C Transferable Record and OA Token Registry minted on Polygon mainnet.
- Updated tests to validate error handling for missing tokenRegistry and tokenNetwork.chainId.
- Adjusted test expectations to ensure proper validation of tampered documents.
- Refactored existing tests to improve clarity and maintainability.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6cc1647b-fbd3-4e37-a0f0-caee3c0804ac

📥 Commits

Reviewing files that changed from the base of the PR and between 019804c and ce55b21.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (19)
  • .github/workflows/ci.yml
  • .github/workflows/tests.yml
  • .gitignore
  • package.json
  • src/__tests__/core/verify.amoy.test.ts
  • src/__tests__/core/verify.pol.test.ts
  • src/__tests__/core/verify.polygon-network.helpers.ts
  • src/__tests__/fixtures/amoy-oa-token-registry-minted.json
  • src/__tests__/fixtures/amoy-w3c-transferable-record-minted.json
  • src/__tests__/fixtures/fixtures.ts
  • src/__tests__/fixtures/pol-oa-token-registry-minted.json
  • src/__tests__/fixtures/pol-w3c-transferable-record-minted.json
  • src/__tests__/fixtures/pol-w3c-verifiable-document.json
  • src/__tests__/token-registry-functions/fixtures.ts
  • src/__tests__/token-registry-functions/transfers.test.ts
  • src/token-registry-functions/utils.ts
  • src/utils/network/index.ts
  • src/utils/supportedChains/index.ts
  • src/utils/supportedChains/supportedChains.test.ts

📝 Walkthrough

Walkthrough

This PR adds Polygon (POL) network support throughout the codebase, updates Amoy testnet configuration with PolygonScan endpoints, refactors gas transaction option handling for ethers v5/v6 compatibility, introduces comprehensive test infrastructure and fixtures for both networks, and bumps the package version alongside dependency updates.

Changes

Polygon POL Support and Test Infrastructure

Layer / File(s) Summary
Chain metadata and network currency updates
src/utils/supportedChains/index.ts, src/utils/network/index.ts, src/utils/supportedChains/supportedChains.test.ts
Adds CHAIN_ID.pol enum value, maintains CHAIN_ID.matic as backward-compatible alias, re-keys Polygon mainnet chain configuration from matic to pol with currency renamed from MATIC to POL, updates Amoy explorer endpoints from OkLink to PolygonScan, adds 'POL' to networkCurrency type union, and updates all related test assertions.
Gas option handling for ethers v5/v6 compatibility
src/token-registry-functions/utils.ts, src/__tests__/token-registry-functions/transfers.test.ts, src/__tests__/token-registry-functions/fixtures.ts
Removes gas-station fallback when maxFeePerGas or maxPriorityFeePerGas are missing, adds ethers v6 BigInt conversion for gas fields, updates token registry transfer tests to use shared gasTxOptions variable, and corrects ethers provider detection in test fixtures.
Polygon network verification test infrastructure
src/__tests__/core/verify.polygon-network.helpers.ts
Adds shared test-helper exports including fixture readiness detection, W3C transferable record test suite generator, OpenAttestation token registry test suite generator, and error assertion helper for unrecognized documents.
Polygon mainnet (POL) verification test suite and fixtures
src/__tests__/core/verify.pol.test.ts, src/__tests__/fixtures/fixtures.ts, src/__tests__/fixtures/pol-*.json
Implements comprehensive POL network test coverage including chain configuration validation, fixture structure assertions, on-chain document status verification with extended timeout, credential tampering scenarios, and offline structural tests for verifiable documents; includes four JSON test fixtures and one TypeScript fixture for minted records.
Polygon Amoy testnet verification test suite and fixtures
src/__tests__/core/verify.amoy.test.ts, src/__tests__/fixtures/amoy-*.json
Adds Amoy network test coverage validating chain ID and metadata with POL currency, conditionally executing fixture-driven integration tests for token registry and transferable records when fixtures are ready using configurable RPC endpoint.
Package version, dependencies, and CI configuration
package.json, .github/workflows/ci.yml, .github/workflows/tests.yml, .gitignore
Bumps package version from 2.13.0 to 2.14.0, updates @tradetrust-tt/tt-verify from ^9.7.4 to ^9.7.5, adds POLYGONSCAN_API_KEY secret to CI and tests workflows for PolygonScan API access, and adds .yalc/ development artifacts to .gitignore.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • TrustVC/trustvc#147: Both PRs implement Polygon (POL) support at the source level by updating networkCurrency and SUPPORTED_CHAINS/CHAIN_ID mappings with corresponding POL test coverage.
  • TrustVC/trustvc#123: Both PRs touch the same chain-metadata code in src/utils/supportedChains/index.ts—the retrieved PR restructures/introduces SUPPORTED_CHAINS, and this PR updates Polygon/Amoy entries (including adding CHAIN_ID.pol and switching Polygon currency to POL).
  • TrustVC/trustvc#130: Both PRs modify src/token-registry-functions/utils.ts—specifically the getTxOptions logic/signature around how gas options are computed for ethers v5/v6 and whether gas-station/chainId handling is used.

Suggested labels

released

Suggested reviewers

  • rongquan1
  • nghaninn

Poem

🐰 Polygon plains now bloom with POL,
Where Amoy and mainnet take their toll,
With helpers stacked and fixtures keen,
The finest networks ever seen!
Gas flows smooth, both v5 and v6,
This testing treasure's now well-mixed!

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/matic-pol-exploer-update
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch feat/matic-pol-exploer-update

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud

Copy link
Copy Markdown

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