-
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
rearrange refund validation checks [SLT-185] #3172
rearrange refund validation checks [SLT-185] #3172
Conversation
WalkthroughThe pull request introduces modifications to the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
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 using PR comments)
Other keywords and placeholders
Documentation and Community
|
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 and nitpick comments (1)
packages/contracts-rfq/contracts/FastBridgeV2.sol (1)
265-267
: LGTM: Status check added as the first validation.This change aligns with the PR objective of rearranging refund validation checks. It ensures that only transactions in the REQUESTED state can be refunded, which is a crucial security measure.
Consider improving the error message for clarity.
While the current error message is functional, it could be more specific to help with debugging and understanding the issue.
Consider updating the error message to be more descriptive:
- if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect(); + if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect("Refund only allowed for REQUESTED status");This change would require updating the
Errors.sol
file to include the new error message.
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (2)
- packages/contracts-rfq/contracts/FastBridgeV2.sol (2 hunks)
- packages/contracts-rfq/test/FastBridgeV2.Src.t.sol (0 hunks)
Files not reviewed due to no reviewable changes (1)
- packages/contracts-rfq/test/FastBridgeV2.Src.t.sol
Additional comments not posted (2)
packages/contracts-rfq/contracts/FastBridgeV2.sol (2)
278-278
: LGTM: Comment updated for clarity.The updated comment provides clear information about when the status is set to REFUNDED, which improves code readability and maintainability.
Line range hint
265-278
: Summary: Refund validation checks successfully rearranged.The changes in the
refund
function effectively address the PR objective of rearranging refund validation checks. By adding the status check as the first validation, the function now ensures that only transactions in the REQUESTED state can be refunded. This improves the overall security and logic of the refund process.The updated comment also enhances code clarity by explicitly stating when the status is set to REFUNDED. These changes contribute to a more robust and maintainable codebase.
Deploying sanguine-fe with Cloudflare Pages
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3172 +/- ##
===================================================
+ Coverage 38.35432% 38.42159% +0.06727%
===================================================
Files 424 424
Lines 24464 24455 -9
Branches 148 148
===================================================
+ Hits 9383 9396 +13
+ Misses 14335 14318 -17
+ Partials 746 741 -5
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.
LGTM - I fixed the tests that I managed to incorrectly define in #3127
…ckValidationImpv--SLT-185-
Bundle ReportChanges will decrease total bundle size by 16.13kB (-0.05%) ⬇️. This is within the configured threshold ✅ Detailed changes
ℹ️ *Bundle size includes cached data from a previous commit |
Description
rearrange refund validation checks - Check transaction status first then check secondaries
Summary by CodeRabbit
New Features
Bug Fixes