Skip to content
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 v010 DistQuery::Rewards bug #1094

Closed
wants to merge 1 commit into from

Conversation

eladr7
Copy link
Contributor

@eladr7 eladr7 commented Aug 25, 2022

When making a DistQuery::Rewards, where the delegator does not have any pending rewards the query returns null for rewards. e.g. {"rewards":null,"total":[]}
The desired result is to return an empty vector in such a case; e.g. {"rewards":[],"total":[]}

*I will change the fix to be more pretty in an upcoming update

@assafmo
Copy link
Member

assafmo commented Aug 25, 2022

Hi, please point the PR to the branch you came out of, rather than master

@assafmo
Copy link
Member

assafmo commented Aug 25, 2022

Also, without the ability to upgrade contracts I'm not sure I feel comfortable fixing this (i.e. breaking the current behavior), as we might already have contracts on mainnet that act upon "null as no rewards" and after this fix will stop functioning correctly.

We might want to wait for contract upgrades before we fix this, or at least reach out to all staking derivatives teams and ask whether this affects them.

Would love more feedback on this.

@eladr7 eladr7 changed the base branch from master to stargate-query August 25, 2022 14:53
@toml01
Copy link
Member

toml01 commented Aug 28, 2022

This fixes #754

@toml01
Copy link
Member

toml01 commented Aug 28, 2022

Yes I tend to agree with @assafmo
Looks like it got fixed on cosmwasm upstream. We should probably wait with this for contract upgrades or if we break backward compatibility in the future..

@liorbond liorbond deleted the branch stargate-query August 31, 2022 12:30
@liorbond liorbond closed this Aug 31, 2022
@assafmo assafmo deleted the fix-v010-DistQuery-Rewards branch September 11, 2022 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants