Skip to content

Commit 2b3d4ad

Browse files
authored
Fix: GetAllApplications sets the Pagination.Limit field to max (#25)
* Fix: GetAllApplications sets the Pagination.Limit field to max * Update godoc comment on GetAllApplications * Update golangci-lint version
1 parent 188eb66 commit 2b3d4ad

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

.github/workflows/run-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ jobs:
3535
- name: golangci-lint
3636
uses: golangci/golangci-lint-action@v6
3737
with:
38-
version: v1.59.1
39-
args: --timeout 10m --verbose
38+
version: v1.62.0
39+
args: --timeout 20m --verbose
4040

4141
- name: Test
4242
run: make test_all

application.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"slices"
88

99
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
10+
query "github.com/cosmos/cosmos-sdk/types/query"
1011
"github.com/pokt-network/poktroll/pkg/crypto/rings"
1112
"github.com/pokt-network/poktroll/x/application/types"
1213
"github.com/pokt-network/ring-go"
@@ -29,12 +30,20 @@ type ApplicationClient struct {
2930
types.QueryClient
3031
}
3132

33+
// TODO_FUTURE(@adshmh): support pagination if/when the number of onchain applications grows enough to cause a performance issue
34+
// with returning all applications at-once.
35+
//
3236
// GetAllApplications returns all applications in the network.
3337
// TODO_TECHDEBT: Add filtering options to this method once they are supported by the on-chain module.
3438
func (ac *ApplicationClient) GetAllApplications(
3539
ctx context.Context,
3640
) ([]types.Application, error) {
37-
req := &types.QueryAllApplicationsRequest{}
41+
req := &types.QueryAllApplicationsRequest{
42+
Pagination: &query.PageRequest{
43+
Limit: query.PaginationMaxLimit,
44+
},
45+
}
46+
3847
res, err := ac.QueryClient.AllApplications(ctx, req)
3948
if err != nil {
4049
return []types.Application{}, err

0 commit comments

Comments
 (0)