Skip to content

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

Open
@baedrik

Description

@baedrik

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.

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions