Skip to content

Commit

Permalink
fix: increase validators list pagination in query
Browse files Browse the repository at this point in the history
  • Loading branch information
freak12techno committed Dec 1, 2024
1 parent cd71323 commit 20730ba
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func TestAppLoadConfigOk(t *testing.T) {

httpmock.RegisterResponder(
"GET",
"https://api.cosmos.quokkastake.io/cosmos/staking/v1beta1/validators?pagination.count_total=true&pagination.limit=1000",
"https://api.cosmos.quokkastake.io/cosmos/staking/v1beta1/validators?pagination.count_total=true&pagination.limit=10000",
httpmock.NewBytesResponder(200, assets.GetBytesOrPanic("validators.json")),
)

Expand Down
6 changes: 3 additions & 3 deletions pkg/fetchers/validators_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func TestValidatorsFetcherQueryError(t *testing.T) {

httpmock.RegisterResponder(
"GET",
"https://api.cosmos.quokkastake.io/cosmos/staking/v1beta1/validators?pagination.count_total=true&pagination.limit=1000",
"https://api.cosmos.quokkastake.io/cosmos/staking/v1beta1/validators?pagination.count_total=true&pagination.limit=10000",
httpmock.NewErrorResponder(errors.New("error")),
)

Expand Down Expand Up @@ -130,7 +130,7 @@ func TestValidatorsFetcherNodeError(t *testing.T) {

httpmock.RegisterResponder(
"GET",
"https://api.cosmos.quokkastake.io/cosmos/staking/v1beta1/validators?pagination.count_total=true&pagination.limit=1000",
"https://api.cosmos.quokkastake.io/cosmos/staking/v1beta1/validators?pagination.count_total=true&pagination.limit=10000",
httpmock.NewBytesResponder(200, assets.GetBytesOrPanic("error.json")),
)

Expand Down Expand Up @@ -170,7 +170,7 @@ func TestValidatorsFetcherQuerySuccess(t *testing.T) {

httpmock.RegisterResponder(
"GET",
"https://api.cosmos.quokkastake.io/cosmos/staking/v1beta1/validators?pagination.count_total=true&pagination.limit=1000",
"https://api.cosmos.quokkastake.io/cosmos/staking/v1beta1/validators?pagination.count_total=true&pagination.limit=10000",
httpmock.NewBytesResponder(200, assets.GetBytesOrPanic("validators.json")),
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/tendermint/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func (rpc *RPC) GetAllValidators(
)
defer span.End()

url := rpc.ChainHost + "/cosmos/staking/v1beta1/validators?pagination.count_total=true&pagination.limit=1000"
url := rpc.ChainHost + "/cosmos/staking/v1beta1/validators?pagination.count_total=true&pagination.limit=10000"

var response *types.ValidatorsResponse
info, err := rpc.Get(url, &response, childQuerierCtx)
Expand Down
2 changes: 1 addition & 1 deletion pkg/types/tendermint.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type Validator struct {
ConsensusPubkey ConsensusPubkey `json:"consensus_pubkey"`
Jailed bool `json:"jailed"`
Status string `json:"status"`
Tokens string `json:"tokens"`
Tokens math.LegacyDec `json:"tokens"`
DelegatorShares math.LegacyDec `json:"delegator_shares"`
Description ValidatorDescription `json:"description"`
UnbondingHeight string `json:"unbonding_height"`
Expand Down

0 comments on commit 20730ba

Please sign in to comment.