Skip to content

Commit

Permalink
Fix: GetAllApplications sets the Pagination.Limit field to max (#25)
Browse files Browse the repository at this point in the history
* Fix: GetAllApplications sets the Pagination.Limit field to max

* Update godoc comment on GetAllApplications

* Update golangci-lint version
  • Loading branch information
adshmh authored Nov 20, 2024
1 parent 188eb66 commit 2b3d4ad
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.59.1
args: --timeout 10m --verbose
version: v1.62.0
args: --timeout 20m --verbose

- name: Test
run: make test_all
11 changes: 10 additions & 1 deletion application.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"slices"

cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
query "github.com/cosmos/cosmos-sdk/types/query"
"github.com/pokt-network/poktroll/pkg/crypto/rings"
"github.com/pokt-network/poktroll/x/application/types"
"github.com/pokt-network/ring-go"
Expand All @@ -29,12 +30,20 @@ type ApplicationClient struct {
types.QueryClient
}

// TODO_FUTURE(@adshmh): support pagination if/when the number of onchain applications grows enough to cause a performance issue
// with returning all applications at-once.
//
// GetAllApplications returns all applications in the network.
// TODO_TECHDEBT: Add filtering options to this method once they are supported by the on-chain module.
func (ac *ApplicationClient) GetAllApplications(
ctx context.Context,
) ([]types.Application, error) {
req := &types.QueryAllApplicationsRequest{}
req := &types.QueryAllApplicationsRequest{
Pagination: &query.PageRequest{
Limit: query.PaginationMaxLimit,
},
}

res, err := ac.QueryClient.AllApplications(ctx, req)
if err != nil {
return []types.Application{}, err
Expand Down

0 comments on commit 2b3d4ad

Please sign in to comment.