-
Notifications
You must be signed in to change notification settings - Fork 169
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!: restrict MsgWithdraw to only accept uToken inputs #1023
Conversation
@AgentRoberto This will impact frontend, so share any thoughts |
Codecov Report
@@ Coverage Diff @@
## main #1023 +/- ##
==========================================
- Coverage 43.86% 43.83% -0.03%
==========================================
Files 64 64
Lines 8337 8322 -15
==========================================
- Hits 3657 3648 -9
+ Misses 4424 4419 -5
+ Partials 256 255 -1
|
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.
let's rename amount.
|
||
if k.IsAcceptedToken(ctx, withdrawal.Denom) { | ||
// Automatically convert base token input to equivalent uTokens | ||
uToken, err = k.ExchangeToken(ctx, withdrawal) |
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.
seams like we had a potential bug here if we the function doesn't handle case where uToken == withdrawal
.
Description
Removes the ability of
MsgWithdraw
to convert base token inputs to uTokens automatically.This fixes a very minor problem, where the double conversion of input
token -> uToken -> token
would result in a final token amount which had been rounded down twice as opposed to once when users input a token amount, e.g.1000uumee -> 999u/uumee -> 998uumee
.With this fix, user input is denominated in uTokens, so the rounding is minimized to the necessary amount.
Runtime verification had mentioned this in a "functional correctness" issue at one point.
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change