-
Notifications
You must be signed in to change notification settings - Fork 142
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 bug on bounty update #730
Conversation
@@ -259,7 +259,9 @@ pub fn update( | |||
} | |||
Ordering::Less => { | |||
// If new amount is less, pay out difference to owner | |||
let diff = old_amount.amount - new_amount.amount; | |||
// in case owner accidentally sent funds, send back as well | |||
let funds_send = may_pay(&info, &bounty.amount.denom)?; |
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.
This is the fix for the bug - also check test below.
.update( | ||
1, | ||
coin(300, "ujuno"), | ||
// case: update bounty with lower amount + owner accidentally send funds |
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.
Test for the fix
) | ||
.unwrap(); | ||
// - assert bounty |
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.
additional check on Bounty
state for making sure all is fine - especially checking in tests for update and payout below.
Question is whether for |
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.
Le nice!
* check Bounty is correct in all tests * fix update bounty with lower amount and owner accidentally send funds * cleanup and test update with sending wrong denom
* check Bounty is correct in all tests * fix update bounty with lower amount and owner accidentally send funds * cleanup and test update with sending wrong denom
* check Bounty is correct in all tests * fix update bounty with lower amount and owner accidentally send funds * cleanup and test update with sending wrong denom
* check Bounty is correct in all tests * fix update bounty with lower amount and owner accidentally send funds * cleanup and test update with sending wrong denom
Bug in contract: