-
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): don't adjust payload.value
that SDK already handles
#3015
Conversation
WalkthroughThe recent changes streamline the handling of payloads within the Synapse interface components. Variable names have been updated for clarity, particularly changing Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant BridgeSDK
participant Application
User->>Application: Initiate Transaction
Application->>BridgeSDK: Call synapseSDK.bridge()
BridgeSDK-->>Application: Return Payload
Application->>User: Confirm Transaction
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
This PR simplifies the handling of bridge and swap transactions by relying on the Synapse SDK's internal value management.
- Removed manual
payload.value
adjustments inexecuteBridge
function instate-managed-bridge/index.tsx
- Simplified
executeSwap
function inswap/index.tsx
by directly using SDK'sswap
method output - Eliminated unnecessary code for
payload.value
manipulation inuseGasEstimator.ts
- Consistent changes across files to use SDK-provided payload without additional processing
- Reduces complexity and potential for errors in frontend code by leveraging SDK's internal handling
3 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 (3)
- packages/synapse-interface/pages/state-managed-bridge/index.tsx (2 hunks)
- packages/synapse-interface/pages/swap/index.tsx (1 hunks)
- packages/synapse-interface/utils/hooks/useGasEstimator.ts (2 hunks)
Additional comments not posted (3)
packages/synapse-interface/utils/hooks/useGasEstimator.ts (1)
Line range hint
187-199
:
Verify impact of removing conditional logic ingetBridgePayload
.The function now directly returns the payload from
synapseSDK.bridge
without previous conditional checks based onfromToken
. Ensure that this change does not negatively impact scenarios where specific token conditions were previously handled.packages/synapse-interface/pages/swap/index.tsx (1)
272-274
: Verify impact of removing conditional logic inexecuteSwap
.The payload is now directly obtained from
synapseSDK.swap
, removing previous conditional handling. Ensure this change does not negatively impact scenarios where specific token conditions were previously considered.Verification successful
No negative impact from removing conditional logic in
executeSwap
.The
executeSwap
function is used directly within the swap page and in theSwapTransactionButton
component. There is no evidence of reliance on the removed conditions, indicating that the simplification does not affect current functionality.
- Usage found in
packages/synapse-interface/pages/swap/index.tsx
- Used in
SwapTransactionButton.tsx
without conditional dependenciesScripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the impact of removing conditional logic in `executeSwap`. # Test: Search for usage of `executeSwap`. Expect: No reliance on removed conditions. rg --type javascript -A 5 $'executeSwap'Length of output: 74
Script:
#!/bin/bash # Description: Verify the impact of removing conditional logic in `executeSwap`. # Test: Search for usage of `executeSwap`. Expect: No reliance on removed conditions. rg --type ts -A 5 $'executeSwap'Length of output: 2291
packages/synapse-interface/pages/state-managed-bridge/index.tsx (1)
436-438
: Verify impact of removing conditional logic inexecuteBridge
.The payload is now directly obtained from
synapseSDK.bridge
, removing previous conditional handling. Ensure this change does not negatively impact scenarios where specific token conditions were previously considered.
Deploying sanguine-fe with Cloudflare Pages
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3015 +/- ##
===================================================
+ Coverage 18.69753% 20.71277% +2.01523%
===================================================
Files 455 490 +35
Lines 42642 42510 -132
Branches 0 82 +82
===================================================
+ Hits 7973 8805 +832
+ Misses 33734 32770 -964
Partials 935 935
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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
1500b3a: synapse-interface preview link