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

R4R: Change /staking/validators endpoint to return all validators candidates #4067

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions x/staking/querier/querier.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,10 @@ func NewQueryRedelegationParams(delegatorAddr sdk.AccAddress, srcValidatorAddr s
}

func queryValidators(ctx sdk.Context, cdc *codec.Codec, k keep.Keeper) (res []byte, err sdk.Error) {
stakingParams := k.GetParams(ctx)
validators := k.GetValidators(ctx, stakingParams.MaxValidators)
validators := k.GetAllValidators(ctx)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the query's documentation states all validators instead of all bonded validators, then this change make sense. Is this the expectation @rigelrozanski?


res, errRes := codec.MarshalJSONIndent(cdc, validators)
if err != nil {
if errRes != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I recall fixing the same issue elsewhere in staking. Perhaps we should do a quick pass through and make sure there aren't other bugs like this 👍

return nil, sdk.ErrInternal(sdk.AppendMsgToErr("could not marshal result to JSON", errRes.Error()))
}
return res, nil
Expand Down