Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imp: add page result to ics29-fee queries #3054

Merged
9 changes: 6 additions & 3 deletions modules/apps/29-fee/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func (k Keeper) IncentivizedPackets(goCtx context.Context, req *types.QueryIncen

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

return &types.QueryIncentivizedPacketsResponse{
IncentivizedPackets: identifiedPackets,
Pagination: pagination,
}, nil
}

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

return &types.QueryIncentivizedPacketsForChannelResponse{
IncentivizedPackets: packets,
Pagination: pagination,
}, nil
}

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

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

return &types.QueryFeeEnabledChannelsResponse{
FeeEnabledChannels: feeEnabledChannels,
Pagination: pagination,
}, nil
}

Expand Down
Loading