-
Notifications
You must be signed in to change notification settings - Fork 32
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
fix(synapse-interface): rfq maps generation #2681
Conversation
WalkthroughThe recent updates introduce Changes
Sequence Diagram(s) (Beta)sequenceDiagram
participant User
participant printMaps
participant originMap
participant tokens
User->>printMaps: Invoke function
printMaps->>originMap: Update with RFQ.ETH and RFQ.USDC
printMaps->>tokens: Add RFQ symbols to origin and destination lists
originMap-->>printMaps: Update complete
tokens-->>printMaps: Update complete
printMaps-->>User: Function execution complete
Poem
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2681 +/- ##
=============================================
Coverage 37.94466% 37.94466%
=============================================
Files 169 169
Lines 13662 13662
Branches 80 80
=============================================
Hits 5184 5184
Misses 7825 7825
Partials 653 653
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this 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
Files selected for processing (2)
- packages/synapse-interface/constants/bridgeMap.ts (34 hunks)
- packages/synapse-interface/scripts/generateMaps.js (2 hunks)
Additional comments not posted (11)
packages/synapse-interface/scripts/generateMaps.js (1)
288-298
: Ensure correct integration of RFQ tokens into the origin map.The addition of
RFQ.ETH
andRFQ.USDC
to the origin map based on specific conditions is well-implemented. It's crucial to ensure that this logic aligns with the business rules for token bridgeability.packages/synapse-interface/constants/bridgeMap.ts (10)
34-42
: AddedRFQ.USDC
to the origin list fornUSD
.This change aligns with the PR's objectives to enhance the handling and mapping of
RFQ
tokens within the system.
71-79
: AddedRFQ.USDC
to the origin list forLUSD
.This addition is consistent with the PR's goal of expanding the bridgeability of
RFQ
tokens.
101-109
: AddedRFQ.USDC
to the origin list forDAI
.The inclusion of
RFQ.USDC
in the origin list forDAI
is in line with the PR's enhancements forRFQ
token mappings.
124-132
: AddedRFQ.USDC
to the origin list forPYUSD
.This update supports the PR's objectives to integrate
RFQ
tokens more broadly within the token swap framework.
161-169
: AddedRFQ.USDC
to the origin list forFRAX
.Consistent with the PR's aim, this change broadens the scope of
RFQ.USDC
within the system's token interactions.
194-194
: AddedRFQ.USDC
to the origin list forUSDC
.Properly extends the
RFQ.USDC
token's reach in line with the PR's objectives.
235-235
: AddedRFQ.ETH
to the origin and destination lists forWETH
andETH
.This change effectively integrates
RFQ.ETH
into the ecosystem, enhancing its utility and accessibility.Also applies to: 242-242
256-264
: AddedRFQ.USDC
to the origin list forUSDT
.This addition is part of the broader initiative to enhance the mapping and utility of
RFQ
tokens.
286-294
: AddedRFQ.USDC
to the origin list forcrvUSD
.Aligns with the PR's goals to expand the usage scenarios for
RFQ.USDC
.
311-311
: AddedRFQ.USDC
andRFQ.ETH
to various tokens across different chains.These additions are consistent with the PR's objectives to enhance the bridgeability and utility of
RFQ
tokens across multiple blockchain networks.Also applies to: 331-331, 355-355, 368-368, 381-381, 391-391, 404-404, 424-424, 444-444
symbol: originTokenSymbol, | ||
decimals: await getTokenDecimals( | ||
origin_chain_id, | ||
normalizedOriginAddress | ||
), | ||
} | ||
} | ||
|
||
// Add RFQ symbol to origin list if not already present | ||
if ( | ||
normalizedOriginAddress in tokens && | ||
!tokens[normalizedOriginAddress].origin.includes( | ||
rfqOriginSymbol | ||
) | ||
) { | ||
tokens[normalizedOriginAddress].origin.push(rfqOriginSymbol) | ||
tokens[normalizedOriginAddress].symbol = originTokenSymbol | ||
tokens[normalizedOriginAddress].decimals = | ||
await getTokenDecimals( | ||
origin_chain_id, | ||
normalizedOriginAddress | ||
) | ||
} | ||
// Add RFQ symbol to destination list if not already present | ||
if ( | ||
!tokens[normalizedOriginAddress].destination.includes( | ||
rfqOriginSymbol | ||
) | ||
) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review the handling of RFQ symbols in token lists.
The logic for adding RFQ symbols to the origin and destination lists of tokens seems correct, but it's important to ensure that these additions do not introduce any unintended side effects, especially in terms of token visibility and swap operations. Consider adding unit tests to verify the behavior of these additions under various scenarios.
+ // Suggested unit test to verify RFQ symbol addition
+ describe('RFQ Symbol Addition', () => {
+ it('should correctly add RFQ symbols to origin and destination lists', async () => {
+ // Setup and invoke the function
+ // Assert the RFQ symbols are added correctly
+ });
+ });
Committable suggestion was skipped due to low confidence.
Description
Adds
RFQ.ETH
andRFQ.USDC
intoorigin
lists of tokens that are bridgeable via "origin swap" + RFQSummary by CodeRabbit
RFQ.USDC
andRFQ.ETH
tokens in the bridge mapping, enhancing token compatibility for users.1160d1f1fa9d1bad2b502e360a5619eeaa622e05: synapse-interface preview link