Skip to content

Commit 5dba356

Browse files
authored
imp: add page result to ics29-fee queries (#3054)
1 parent a244245 commit 5dba356

File tree

3 files changed

+281
-88
lines changed

3 files changed

+281
-88
lines changed

modules/apps/29-fee/keeper/grpc_query.go

+6-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func (k Keeper) IncentivizedPackets(goCtx context.Context, req *types.QueryIncen
2525

2626
var identifiedPackets []types.IdentifiedPacketFees
2727
store := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(types.FeesInEscrowPrefix))
28-
_, err := query.Paginate(store, req.Pagination, func(key, value []byte) error {
28+
pagination, err := query.Paginate(store, req.Pagination, func(key, value []byte) error {
2929
packetID, err := types.ParseKeyFeesInEscrow(types.FeesInEscrowPrefix + string(key))
3030
if err != nil {
3131
return err
@@ -41,6 +41,7 @@ func (k Keeper) IncentivizedPackets(goCtx context.Context, req *types.QueryIncen
4141

4242
return &types.QueryIncentivizedPacketsResponse{
4343
IncentivizedPackets: identifiedPackets,
44+
Pagination: pagination,
4445
}, nil
4546
}
4647

@@ -75,7 +76,7 @@ func (k Keeper) IncentivizedPacketsForChannel(goCtx context.Context, req *types.
7576
var packets []*types.IdentifiedPacketFees
7677
keyPrefix := types.KeyFeesInEscrowChannelPrefix(req.PortId, req.ChannelId)
7778
store := prefix.NewStore(ctx.KVStore(k.storeKey), keyPrefix)
78-
_, err := query.Paginate(store, req.Pagination, func(key, value []byte) error {
79+
pagination, err := query.Paginate(store, req.Pagination, func(key, value []byte) error {
7980
packetID, err := types.ParseKeyFeesInEscrow(string(keyPrefix) + string(key))
8081
if err != nil {
8182
return err
@@ -94,6 +95,7 @@ func (k Keeper) IncentivizedPacketsForChannel(goCtx context.Context, req *types.
9495

9596
return &types.QueryIncentivizedPacketsForChannelResponse{
9697
IncentivizedPackets: packets,
98+
Pagination: pagination,
9799
}, nil
98100
}
99101

@@ -217,7 +219,7 @@ func (k Keeper) FeeEnabledChannels(goCtx context.Context, req *types.QueryFeeEna
217219

218220
var feeEnabledChannels []types.FeeEnabledChannel
219221
store := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(types.FeeEnabledKeyPrefix))
220-
_, err := query.Paginate(store, req.Pagination, func(key, value []byte) error {
222+
pagination, err := query.Paginate(store, req.Pagination, func(key, value []byte) error {
221223
portID, channelID, err := types.ParseKeyFeeEnabled(types.FeeEnabledKeyPrefix + string(key))
222224
if err != nil {
223225
return err
@@ -238,6 +240,7 @@ func (k Keeper) FeeEnabledChannels(goCtx context.Context, req *types.QueryFeeEna
238240

239241
return &types.QueryFeeEnabledChannelsResponse{
240242
FeeEnabledChannels: feeEnabledChannels,
243+
Pagination: pagination,
241244
}, nil
242245
}
243246

0 commit comments

Comments
 (0)