Skip to content

Conversation

@pclaesen
Copy link
Contributor

@pclaesen pclaesen commented Jan 30, 2026

Viem only supports gnosis and mainnet as chain name, 'ethereum' is not a supported chain name. Fixes #34

Summary by CodeRabbit

  • Chores
    • Updated blockchain network configurations to support current chain mappings.
    • Reorganized payment processing network references across data queries.

✏️ Tip: You can customize this high-level summary in your review settings.

Viem only supports gnosis and mainnet as chain name, 'ethereum' is not a supported chain name.
Fixes RequestNetwork#34
@MantisClone
Copy link
Member

Hello @pclaesen, thank you for submitting your first pull request to the request-scan repository. We value your contribution and encourage you to review our contribution guidelines to ensure your submission meets our standards. Please note that every merged PR is automatically enrolled in our Best PR Initiative, offering a chance to win $500 each quarter. Our team is available via GitHub Discussions or Discord if you have any questions. Welcome aboard!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 30, 2026

Walkthrough

Updates blockchain chain identifiers throughout the codebase by replacing XDAI with GNOSIS, removing MAINNET from enums, adding ETHEREUM mappings, and refactoring GraphQL payment network field references across multiple query definitions to reflect new chain source mappings.

Changes

Cohort / File(s) Summary
Chain Configuration
src/lib/consts.ts
Updated public chain enum to replace MAINNET with ETHEREUM, replaced XDAI with GNOSIS, and updated scan URLs and PUBLIC_CLIENTS configuration accordingly.
GraphQL Payment Queries
src/lib/hooks/payments.ts, src/lib/queries/payments.ts, src/lib/queries/address-payments.ts, src/lib/queries/request-payments.ts
Refactored payment network field names in GraphQL queries by systematically remapping: payment_mainnet → payment_arbitrum_one, payment_arbitrum_one → payment_avalanche, payment_avalanche → payment_base, payment_base → payment_bsc, payment_bsc → payment_celo, payment_celo → payment_ethereum, and payment_xdai → payment_gnosis.
Deployment Queries
src/lib/queries/srf-deployments.ts
Updated PROXY_DEPLOYMENTS_QUERY and PROXY_DEPLOYMENTS_BY_REFERENCE_QUERY to apply the same payment network field remapping and removed payment_mainnet while adding payment_ethereum.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly and concisely describes the main changes: renaming xdai to gnosis and mainnet to ethereum identifiers across the codebase.
Linked Issues check ✅ Passed The PR addresses issue #34 by renaming chain identifiers from 'xdai' to 'gnosis' across configuration, enums, and GraphQL queries, which resolves the UI discrepancy.
Out of Scope Changes check ✅ Passed All changes are consistent with the stated objective of renaming xdai to gnosis and mainnet to ethereum chain identifiers; no unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

🧪 Unit Test Generation v2 is now available!

We have significantly improved our unit test generation capabilities.

To enable: Add this to your .coderabbit.yaml configuration:

reviews:
  finishing_touches:
    unit_tests:
      enabled: true

Try it out by using the @coderabbitai generate unit tests command on your code files or under ✨ Finishing Touches on the walkthrough!

Have feedback? Share your thoughts on our Discord thread!


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.

@MantisClone
Copy link
Member

Thank you for your submission! As you prepare for the review process, please ensure that your PR title, description, and any linked issues fully comply with our contribution guidelines. A clear explanation of your changes and their context will help expedite the review process. Every merged PR is automatically entered into our Best PR Initiative, offering a chance to win $500 every quarter. We appreciate your attention to detail and look forward to reviewing your contribution!

@greptile-apps
Copy link

greptile-apps bot commented Jan 30, 2026

Greptile Overview

Greptile Summary

Renamed chain identifiers from MAINNET to ETHEREUM and XDAI to GNOSIS throughout the codebase to align with Viem's naming requirements.

The changes update:

  • Constants (src/lib/consts.ts): Renamed enum keys in CHAINS, PAYMENT_CHAINS, and corresponding entries in PUBLIC_CLIENTS and CHAIN_SCAN_URLS
  • GraphQL Queries: Updated field names from payment_mainnet to payment_ethereum and payment_xdai to payment_gnosis across all query files

The actual chain values remain correct ("mainnet" and "gnosis") as required by Viem. The refactoring ensures the codebase uses semantically clearer naming (ETHEREUM instead of MAINNET) while maintaining compatibility with Viem's chain definitions.

A minor style inconsistency exists in request-payments.ts where the payment_ethereum block has parameters in a different order than other blocks, though this doesn't affect functionality in GraphQL.

Confidence Score: 4.5/5

  • This PR is safe to merge with very low risk
  • Systematic renaming changes that are well-contained and verified. The only minor issue is a parameter ordering inconsistency that doesn't affect functionality. All usages have been updated consistently, and the Viem compatibility requirement is correctly satisfied.
  • src/lib/queries/request-payments.ts has a minor parameter ordering inconsistency that should be standardized for consistency

Important Files Changed

Filename Overview
src/lib/consts.ts Renamed MAINNET to ETHEREUM and XDAI to GNOSIS in CHAINS, PAYMENT_CHAINS, PUBLIC_CLIENTS, and CHAIN_SCAN_URLS
src/lib/queries/payments.ts Updated GraphQL query field names from payment_mainnet to payment_ethereum and payment_xdai to payment_gnosis
src/lib/queries/request-payments.ts Updated GraphQL query field names and fixed parameter ordering inconsistency in payment_ethereum block

Sequence Diagram

sequenceDiagram
    participant App as Application
    participant Consts as consts.ts
    participant Queries as GraphQL Queries
    participant GQL as GraphQL Client
    participant Subgraph as The Graph Subgraph
    participant Viem as Viem Public Clients
    
    Note over Consts: CHAINS.ETHEREUM = "mainnet"<br/>CHAINS.GNOSIS = "gnosis"
    Note over Consts: PAYMENT_CHAINS.ETHEREUM = "payment_ethereum"<br/>PAYMENT_CHAINS.GNOSIS = "payment_gnosis"
    
    App->>Queries: fetchPayments()
    Queries->>GQL: Execute PAYMENTS_QUERY
    Note over Queries: Query uses payment_ethereum<br/>instead of payment_mainnet
    GQL->>Subgraph: payment_ethereum { payments(...) }
    GQL->>Subgraph: payment_gnosis { payments(...) }
    Subgraph-->>GQL: Payment data
    GQL-->>Queries: Formatted results
    Queries-->>App: Payment[]
    
    App->>Consts: Access PUBLIC_CLIENTS[CHAINS.ETHEREUM]
    Consts->>Viem: createPublicClient({ chain: mainnet })
    Note over Viem: Viem expects "mainnet" and "gnosis"<br/>as valid chain identifiers
    Viem-->>Consts: Public client instance
    Consts-->>App: Configured client
    
    App->>Consts: Access CHAIN_SCAN_URLS[CHAINS.ETHEREUM]
    Consts-->>App: "https://etherscan.io"
Loading

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

3 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Comment on lines +59 to +63
payment_ethereum {
payments(
where: { reference: $reference }
orderBy: timestamp
orderDirection: desc
where: { reference: $reference }
Copy link

Choose a reason for hiding this comment

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

Inconsistent parameter ordering: where comes after orderBy in payment_ethereum block, while all other blocks have where first.

Suggested change
payment_ethereum {
payments(
where: { reference: $reference }
orderBy: timestamp
orderDirection: desc
where: { reference: $reference }
payment_ethereum {
payments(
where: { reference: $reference }
orderBy: timestamp
orderDirection: desc
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/lib/queries/request-payments.ts
Line: 59:63

Comment:
Inconsistent parameter ordering: `where` comes after `orderBy` in `payment_ethereum` block, while all other blocks have `where` first.

```suggestion
    payment_ethereum {
      payments(
        where: { reference: $reference }
        orderBy: timestamp
        orderDirection: desc
```

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +14 to +16
payment_arbitrum_one {
payments(
where: { reference: $reference }
Copy link

Choose a reason for hiding this comment

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

Inconsistent parameter ordering: where comes before orderBy in payment_arbitrum_one block, while the old payment_mainnet had it after. Consider keeping same order as other blocks.

Suggested change
payment_arbitrum_one {
payments(
where: { reference: $reference }
payment_arbitrum_one {
payments(
where: { reference: $reference }

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/lib/queries/request-payments.ts
Line: 14:16

Comment:
Inconsistent parameter ordering: `where` comes before `orderBy` in `payment_arbitrum_one` block, while the old `payment_mainnet` had it after. Consider keeping same order as other blocks.

```suggestion
    payment_arbitrum_one {
      payments(
        where: { reference: $reference }
```

<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>

How can I resolve this? If you propose a fix, please make it concise.

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.

On the payments table, Blockchain column, for payments on gnosis, display "gnosis", not "xdai"

2 participants