Skip to content

Commit

Permalink
fix(zetacore): add default cctx list pagination size
Browse files Browse the repository at this point in the history
  • Loading branch information
gartnera committed Sep 12, 2024
1 parent 1929ff6 commit 7e3356a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions x/crosschain/keeper/grpc_query_cctx.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ const (

// MaxLookbackNonce is the maximum number of nonces to look back to find missed pending cctxs
MaxLookbackNonce = 1000

defaultPageSize = 100
)

func (k Keeper) ZetaAccounting(
Expand All @@ -46,6 +48,10 @@ func (k Keeper) CctxAll(c context.Context, req *types.QueryAllCctxRequest) (*typ
store := ctx.KVStore(k.storeKey)
sendStore := prefix.NewStore(store, types.KeyPrefix(types.CCTXKey))

if req.Pagination.Limit == 0 {
req.Pagination.Limit = defaultPageSize
}

pageRes, err := query.Paginate(sendStore, req.Pagination, func(_ []byte, value []byte) error {
var send types.CrossChainTx
if err := k.cdc.Unmarshal(value, &send); err != nil {
Expand Down

0 comments on commit 7e3356a

Please sign in to comment.