-
Notifications
You must be signed in to change notification settings - Fork 101
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
[CORE-709] do not error when completing a bridge with non-positive amount #691
Conversation
WalkthroughThe changes primarily focus on enhancing the logic and accuracy of the Changes
TipsChat with CodeRabbit Bot (
|
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 Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (2)
- protocol/x/bridge/keeper/complete_bridge.go (1 hunks)
- protocol/x/bridge/keeper/complete_bridge_test.go (5 hunks)
Files skipped from review due to trivial changes (2)
- protocol/x/bridge/keeper/complete_bridge.go
- protocol/x/bridge/keeper/complete_bridge_test.go
// If coin amount is positive, send coin from bridge module account to | ||
// specified account. | ||
if bridge.Coin.Amount.IsPositive() { | ||
err = k.bankKeeper.SendCoinsFromModuleToAccount( |
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.
nit:
if err = .....; err != nil {
return err
}
return err | ||
// If coin amount is positive, send coin from bridge module account to | ||
// specified account. | ||
if bridge.Coin.Amount.IsPositive() { |
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.
I see we have taken the approach to still schedule delayed messages for 0
transfers.
Can you document somewhere the rationale behind tradeoffs of different approaches, and why we are allowing zero-transfer delay messages to be added to state?
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.
Documented rationale in PR description!
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 Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (2)
- protocol/x/bridge/keeper/complete_bridge.go (1 hunks)
- protocol/x/bridge/keeper/complete_bridge_test.go (5 hunks)
Files skipped from review due to trivial changes (2)
- protocol/x/bridge/keeper/complete_bridge.go
- protocol/x/bridge/keeper/complete_bridge_test.go
…ount (backport #691) (#707) * [CORE-709] do not error when completing a bridge with non-positive amount (#691) * do not error when completing a bridge with non-positive amount (cherry picked from commit 525873d) # Conflicts: # protocol/x/bridge/keeper/complete_bridge_test.go * fix merge conflict --------- Co-authored-by: Tian <tian@dydx.exchange>
Changelist
When completing a bridge with non-positive amount, do not error. Simply ignore bank transfer and consider the bridge completed.
Approaches considered for bridges with 0 amount
CompleteBridge
)MsgCompleteBridge
scheduled for it (as gas has been paid anyways on Ethereum side)MsgCompleteBridge
Test Plan
[Describe how this PR was tested (if applicable)]
Author/Reviewer Checklist
state-breaking
label.PrepareProposal
orProcessProposal
, manually add the labelproposal-breaking
.feature:[feature-name]
.backport/[branch-name]
.refactor
,chore
,bug
.