Skip to content

Commit

Permalink
Temporarily fix QuerySubscriptionsForAccount
Browse files Browse the repository at this point in the history
  • Loading branch information
bsrinivas8687 committed Aug 30, 2023
1 parent 6c51528 commit 0426831
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions x/subscription/keeper/query_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,19 +96,23 @@ func (q *queryServer) QuerySubscriptionsForAccount(c context.Context, req *types
store = prefix.NewStore(q.Store(ctx), types.GetSubscriptionForAccountKeyPrefix(addr))
)

pagination, err := query.Paginate(store, req.Pagination, func(key, _ []byte) error {
pagination, err := query.FilteredPaginate(store, req.Pagination, func(key, _ []byte, accumulate bool) (bool, error) {
if !accumulate {
return false, nil
}

v, found := q.GetSubscription(ctx, sdk.BigEndianToUint64(key))
if !found {
return fmt.Errorf("subscription for key %X does not exist", key)
return false, nil
}

item, err := codectypes.NewAnyWithValue(v)
if err != nil {
return err
return false, err
}

items = append(items, item)
return nil
return true, nil
})

if err != nil {
Expand Down

0 comments on commit 0426831

Please sign in to comment.