Skip to content
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

api test fixes #3228

Merged
merged 1 commit into from
Oct 4, 2024
Merged

api test fixes #3228

merged 1 commit into from
Oct 4, 2024

Conversation

Defi-Moses
Copy link
Collaborator

@Defi-Moses Defi-Moses commented Oct 4, 2024

For some reason USDCe was missing and thus tests were failing

Summary by CodeRabbit

  • New Features

    • Updated address mappings for USDC and USDCe tokens on the POLYGON chain.
    • Introduced a new token, SPECTRAL, with complete properties including address, symbol, and image URL.
  • Bug Fixes

    • Ensured correct token definitions and addresses across various chains.

Copy link
Contributor

coderabbitai bot commented Oct 4, 2024

Walkthrough

The changes in this pull request primarily involve updates to the bridgeable.ts file, focusing on the BridgeableToken constants. Modifications include updated address mappings for the USDC and USDCe tokens on the POLYGON chain, as well as the introduction of a new token, SPECTRAL, with its associated properties. The overall structure of the token definitions remains consistent, ensuring uniformity across the file.

Changes

File Path Change Summary
packages/rest-api/src/constants/bridgeable.ts - Updated USDC address for POLYGON chain.
- Added USDCe address for POLYGON chain.
- Introduced new token SPECTRAL with properties.

Possibly related PRs

  • feat(widget): Adds scroll #2805: The changes in bridgeable.ts for adding support for the SCROLL chain may relate to the modifications in the same file in the main PR, which also involves updates to token definitions.
  • feat(widget): adds METIS token support #3046: The addition of the METIS token in bridgeable.ts aligns with the main PR's updates to token constants, indicating a shared focus on enhancing token definitions.
  • feat(synapse-interface): METIS token #3044: Similar to the above, this PR introduces the METIS token in bridgeable.ts, which is directly related to the changes made in the main PR regarding token constants.

Suggested labels

M-deps, size/m, Sol, Typescript

Suggested reviewers

  • abtestingalpha
  • trajan0x
  • bigboydiamonds

🐇 In the land of code where tokens dwell,
USDC and SPECTRAL ring their bell.
Addresses updated, all in a row,
On POLYGON's chain, watch them glow!
With each little change, our bridge grows wide,
Hop along, dear friends, let’s take this ride! 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 26f0396 and e50fb81.

📒 Files selected for processing (1)
  • packages/rest-api/src/constants/bridgeable.ts (2 hunks)
🔇 Additional comments (2)
packages/rest-api/src/constants/bridgeable.ts (2)

997-997: Verify the reclassification of USDC to USDCe on POLYGON

The address previously associated with USDC on the POLYGON chain (0x2791bca1f2de4661ed88a30c99a7a9449aa84174) has now been reclassified as USDCe. This is a significant change in token classification.

+    [CHAINS.POLYGON.id]: '0x2791bca1f2de4661ed88a30c99a7a9449aa84174',

Please confirm that this reclassification is intentional and correct. This change could have substantial implications for how these tokens are handled in the system, particularly in terms of bridging operations and user interactions.

To verify this change and its implications, you can run the following script:

#!/bin/bash
# Verify the reclassification of USDC to USDCe on Polygon
echo "Checking for occurrences of the address in USDC and USDCe definitions"
rg --type typescript "0x2791bca1f2de4661ed88a30c99a7a9449aa84174" -C 10
echo "Checking for any references to USDCe on Polygon in other parts of the codebase"
rg --type typescript "USDCe.*POLYGON" -C 5

This script will help identify any inconsistencies or areas that might need updating due to this reclassification.


Line range hint 1141-1160: Verify the newly added SPECTRAL token

The SPECTRAL token has been added with the following properties:

export const SPECTRAL: BridgeableToken = {
  priorityRank: 600,
  addresses: {
    [CHAINS.ETHEREUM.id]: '0xAdF7C35560035944e805D98fF17d58CDe2449389',
    [CHAINS.BASE.id]: '0x96419929d7949D6A801A6909c145C8EEf6A40431',
  },
  decimals: {
    [CHAINS.ETHEREUM.id]: 18,
    [CHAINS.BASE.id]: 18,
  },
  symbol: 'SPEC',
  name: 'Spectral Token',
  swapableType: 'SPEC',
  color: 'blue',
  routeSymbol: 'SPEC',
  imgUrl:
    'https://105bc697.sanguine-fe.pages.dev/_next/static/media/spectral.6d51750c.svg',
}

The structure and properties of the SPECTRAL token definition are consistent with other token definitions in the file. However, please verify the following:

  1. The correctness of the addresses for both ETHEREUM and BASE chains.
  2. The accuracy of the decimals values.
  3. The appropriateness of the priorityRank value.
  4. The validity of the imgUrl.

To verify the SPECTRAL token information, you can run the following script:

#!/bin/bash
# Verify SPECTRAL token information
echo "Checking for other occurrences of SPECTRAL token addresses"
rg --type typescript "0xAdF7C35560035944e805D98fF17d58CDe2449389" -C 5
rg --type typescript "0x96419929d7949D6A801A6909c145C8EEf6A40431" -C 5
echo "Checking for any other references to SPECTRAL or SPEC tokens"
rg --type typescript "SPECTRAL|SPEC" -C 5

This script will help identify any inconsistencies or additional references to the SPECTRAL token that might need attention.

@@ -434,7 +434,7 @@ export const USDC: BridgeableToken = {
[CHAINS.AVALANCHE.id]: '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e',
[CHAINS.DFK.id]: '0x3AD9DFE640E1A9Cc1D9B0948620820D975c3803a',
[CHAINS.BASE.id]: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
[CHAINS.POLYGON.id]: '0x2791bca1f2de4661ed88a30c99a7a9449aa84174',
[CHAINS.POLYGON.id]: '0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359',
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Remove all remaining references to the old USDC address on the POLYGON chain

The old USDC token address '0x2791bca1f2de4661ed88a30c99a7a9449aa84174' is still referenced in multiple parts of the codebase. This could lead to inconsistencies and potential issues with integrations.

  • Files containing the old address:
    • packages/synapse-interface/constants/tokens/bridgeable.ts
    • packages/widget/src/constants/bridgeable.ts
    • packages/rest-api/src/constants/bridgeable.ts

Please update or remove these references to ensure consistency across the codebase.

🔗 Analysis chain

Verify the new USDC address for POLYGON chain

The USDC token address for the POLYGON chain has been updated. This is a significant change that could affect existing integrations and user interactions.

-    [CHAINS.POLYGON.id]: '0x2791bca1f2de4661ed88a30c99a7a9449aa84174',
+    [CHAINS.POLYGON.id]: '0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359',

Please ensure that this new address is correct and that all necessary updates have been made in other parts of the codebase that might reference this address.

To verify the correctness of this address, you can run the following script:

This script will search for occurrences of both the new and old addresses, helping to ensure consistency across the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify the new USDC address on Polygon
echo "Verifying USDC address on Polygon"
rg --type typescript "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359" -C 5
echo "Checking for any remaining occurrences of the old address"
rg --type typescript "0x2791bca1f2de4661ed88a30c99a7a9449aa84174" -C 5

Length of output: 548


Script:

#!/bin/bash
# Verify the new USDC address on Polygon with corrected file type
echo "Verifying USDC address on Polygon"
rg --type ts "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359" -C 5
echo "Checking for any remaining occurrences of the old address"
rg --type ts "0x2791bca1f2de4661ed88a30c99a7a9449aa84174" -C 5

Length of output: 29272

Copy link

Deploying sanguine-fe with  Cloudflare Pages  Cloudflare Pages

Latest commit: e50fb81
Status: ✅  Deploy successful!
Preview URL: https://f78fd58a.sanguine-fe.pages.dev
Branch Preview URL: https://fix-api-tests.sanguine-fe.pages.dev

View logs

Copy link

codecov bot commented Oct 4, 2024

Bundle Report

Bundle size has no change ✅

@abtestingalpha abtestingalpha merged commit b7c00cb into master Oct 4, 2024
35 checks passed
@abtestingalpha abtestingalpha deleted the fix/api-tests branch October 4, 2024 14:16
Copy link

codecov bot commented Oct 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (master@26f0396). Learn more about missing BASE report.
Report is 2 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master       #3228   +/-   ##
============================================
  Coverage          ?   90.43902%           
============================================
  Files             ?          54           
  Lines             ?        1025           
  Branches          ?          82           
============================================
  Hits              ?         927           
  Misses            ?          95           
  Partials          ?           3           
Flag Coverage Δ
packages 90.43902% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants