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

Null response from DistQuery::Rewards when there are no rewards #754

Open
baedrik opened this issue May 26, 2021 · 1 comment
Open

Null response from DistQuery::Rewards when there are no rewards #754

baedrik opened this issue May 26, 2021 · 1 comment
Assignees
Labels
bug Something isn't working CosmWasm v0.10 p-low

Comments

@baedrik
Copy link
Contributor

baedrik commented May 26, 2021

When a secret contract attempts to do the Rewards query from the Distribution module like follows (where delegator is the HumanAddr whose rewards you want to view):

    let rewards_resp: RewardsResponse = deps.querier.query(&QueryRequest::Dist(DistQuery::Rewards {
       delegator,
    }))?;

If the delegator does not have any pending rewards, the query returns a null response which causes a parse error. Instead it should always return a valid RewardsResponse, but when there are no rewards, the rewards and total fields should be empty Vecs.

@assafmo assafmo added bug Something isn't working CosmWasm v0.10 IBC labels May 27, 2021
@assafmo assafmo moved this to Todo in CosmWasm v1 Jul 20, 2022
@eladr7 eladr7 self-assigned this Aug 24, 2022
@assafmo
Copy link
Member

assafmo commented Sep 20, 2022

@liorbond is this fixed in v1.4?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CosmWasm v0.10 p-low
Projects
No open projects
Status: To Do
Development

No branches or pull requests

3 participants