Skip to content

Commit

Permalink
add page flags for staking validators (cosmos#8103)
Browse files Browse the repository at this point in the history
* add page flags for staking validators

* add test

* fix test

* add build flag

Co-authored-by: aleem1413 <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Dec 10, 2020
1 parent c0f3039 commit e321317
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions x/staking/client/cli/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,10 @@ func (s *IntegrationTestSuite) TestGetCmdQueryValidators() {
}{
{
"one validator case",
[]string{fmt.Sprintf("--%s=json", tmcli.OutputFlag)},
[]string{
fmt.Sprintf("--%s=json", tmcli.OutputFlag),
fmt.Sprintf("--%s=1", flags.FlagLimit),
},
1,
},
{
Expand All @@ -278,7 +281,7 @@ func (s *IntegrationTestSuite) TestGetCmdQueryValidators() {

var result types.QueryValidatorsResponse
s.Require().NoError(clientCtx.JSONMarshaler.UnmarshalJSON(out.Bytes(), &result))
s.Require().Equal(len(s.network.Validators), len(result.Validators))
s.Require().Equal(tc.minValidatorCount, len(result.Validators))
})
}
}
Expand Down
1 change: 1 addition & 0 deletions x/staking/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ $ %s query staking validators
}

flags.AddQueryFlagsToCmd(cmd)
flags.AddPaginationFlagsToCmd(cmd, "validators")

return cmd
}
Expand Down

0 comments on commit e321317

Please sign in to comment.