Skip to content

Commit

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

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

pagination, err := query.Paginate(store, req.Pagination, func(key, _ []byte) error {
v, found := q.GetSubscription(ctx, sdk.BigEndianToUint64(key))
if !found {
return false, nil
return fmt.Errorf("subscription for key %X does not exist", key)
}

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

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

if err != nil {
Expand Down

0 comments on commit f04bbac

Please sign in to comment.