-
Notifications
You must be signed in to change notification settings - Fork 42
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 delegation queries #25
Conversation
The lint failure is unrelated to these changes |
d24febd
to
2dd219d
Compare
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
if amount > 0 { | ||
if !amount.is_zero() { |
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 same, isn't it?
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.
Yes, it's the same. amount
now is Uint128
instead of u128
and I don't like the look of amount > Uint128::zero()
when there is an explicit function to check that.
// save updated values | ||
if shares.stake.is_zero() { | ||
if shares.stake.is_zero() && unbonding.is_zero() { |
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.
And this was cruicial. 👍
delegator, | ||
validator, | ||
amount: amount.clone(), | ||
can_redelegate: amount, // TODO: not implemented right now |
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.
Fair enough, not implemented properly in wasmd either
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.
Looks good. Thanks for bringing this fix in
The delegation queries should actually include the unbonding amounts. This should fix that behaviour.