-
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
feat(synapse-interface): use origin user address for getting bridge quotes #2969
Conversation
WalkthroughThis update enhances the functionality of the Changes
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 Configuration File (
|
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.
PR Summary
The changes focus on adding the originUserAddress
parameter to the synapseSDK.allBridgeQuotes
function call to improve the accuracy of bridge quotes by considering the user's address.
- File:
packages/synapse-interface/pages/state-managed-bridge/index.tsx
- Added
originUserAddress
parameter tosynapseSDK.allBridgeQuotes
function call.
- Added
- File:
packages/synapse-interface/utils/hooks/useGasEstimator.ts
- Added
userAddress
parameter togetBridgeQuote
function and updated function calls accordingly.
- Added
2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
Deploying sanguine-fe with Cloudflare Pages
|
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: 0
Outside diff range, codebase verification and nitpick comments (2)
packages/synapse-interface/utils/hooks/useGasEstimator.ts (1)
154-166
: Function calls togetBridgeQuote
do not match the new signatureThe function
getBridgeQuote
now requires an additionaluserAddress
parameter. However, the current calls to this function do not include this new parameter.
- File:
packages/synapse-interface/utils/hooks/useGasEstimator.ts
- Line: 154
- Current Call:
const bridgeQuote = await getBridgeQuote( synapseSDK, fromChainId, toChainId, fromToken, toToken, );- Expected Call:
const bridgeQuote = await getBridgeQuote( synapseSDK, fromChainId, toChainId, fromToken, toToken, amount, userAddress, );Please update the function calls to include the
userAddress
parameter.Analysis chain
LGTM! But verify the function usage in the codebase.
The code changes are approved.
However, ensure that all function calls to
getBridgeQuote
match the new signature.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `getBridgeQuote` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type python -A 5 $'getBridgeQuote'Length of output: 69
Script:
#!/bin/bash # Description: Verify all function calls to `getBridgeQuote` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type ts -A 5 $'getBridgeQuote'Length of output: 1437
packages/synapse-interface/pages/state-managed-bridge/index.tsx (1)
166-169
: Function calls togetAndSetBridgeQuote
need updatingThe function
getAndSetBridgeQuote
is called without parameters in several places, which does not match the new signature that includes theoriginUserAddress
parameter. Please update the following instances to include the required parameter:
packages/synapse-interface/pages/state-managed-bridge/index.tsx:
- Line 1:
getAndSetBridgeQuote()
- Line 2:
getAndSetBridgeQuote()
- Line 3:
getAndSetBridgeQuote()
- Line 4:
getAndSetBridgeQuote()
Analysis chain
LGTM! But verify the function usage in the codebase.
The code changes are approved.
However, ensure that all function calls to
getAndSetBridgeQuote
match the new signature.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `getAndSetBridgeQuote` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type python -A 5 $'getAndSetBridgeQuote'Length of output: 75
Script:
#!/bin/bash # Description: Verify all function calls to `getAndSetBridgeQuote` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type ts -A 5 $'getAndSetBridgeQuote'Length of output: 2932
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (2)
- packages/synapse-interface/pages/state-managed-bridge/index.tsx (1 hunks)
- packages/synapse-interface/utils/hooks/useGasEstimator.ts (2 hunks)
Additional comments not posted (1)
packages/synapse-interface/utils/hooks/useGasEstimator.ts (1)
255-256
: LGTM! But verify the function usage in the codebase.The code changes are approved.
However, ensure that all function calls to
queryEstimatedBridgeGasLimit
match the new signature.Verification successful
All function calls to
queryEstimatedBridgeGasLimit
match the new signature.The function
queryEstimatedBridgeGasLimit
is only called within its own file, and all calls use the correct new signature.
packages/synapse-interface/utils/hooks/useGasEstimator.ts
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `queryEstimatedBridgeGasLimit` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type python -A 5 $'queryEstimatedBridgeGasLimit'Length of output: 83
Script:
#!/bin/bash # Description: Verify all function calls to `queryEstimatedBridgeGasLimit` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type typescript -A 5 'queryEstimatedBridgeGasLimit'Length of output: 91
Script:
#!/bin/bash # Description: Verify all function calls to `queryEstimatedBridgeGasLimit` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type ts -A 5 'queryEstimatedBridgeGasLimit'Length of output: 1060
Script:
#!/bin/bash # Description: Verify all function calls to `queryEstimatedBridgeGasLimit` match the new signature across the entire codebase. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg 'queryEstimatedBridgeGasLimit'Length of output: 255
Bundle ReportChanges will increase total bundle size by 7.73MB ⬆️
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2969 +/- ##
===================================================
- Coverage 25.71434% 25.71254% -0.00180%
===================================================
Files 771 771
Lines 55576 55576
Branches 82 82
===================================================
- Hits 14291 14290 -1
Misses 39801 39801
- Partials 1484 1485 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
ba8e1b4
to
f3ae14a
Compare
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.
PR Summary
(updates since last review)
This PR enhances the bridge quote functionality by incorporating the user's address in the useGasEstimator
hook, improving the accuracy of gas limit calculations.
- Updated
getBridgeQuote
function inuseGasEstimator.ts
to includeuserAddress
parameter - Added
originUserAddress
option tosynapseSDK.bridgeQuote
call for personalized quotes - Refactored
queryEstimatedBridgeGasLimit
to pass user address togetBridgeQuote
- Ensured consistency with changes made in
state-managed-bridge/index.tsx
1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
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: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- packages/synapse-interface/utils/hooks/useGasEstimator.ts (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- packages/synapse-interface/utils/hooks/useGasEstimator.ts
Description
A clear and concise description of the features you're adding in this pull request.
Additional context
Add any other context about the problem you're solving.
Metadata
Summary by CodeRabbit
New Features
Bug Fixes
fd8c3bf: synapse-interface preview link
b5a648e: synapse-interface preview link