From 7e3356aaa089c2ad451d79fe972daadc27d0ab22 Mon Sep 17 00:00:00 2001 From: Alex Gartner Date: Thu, 12 Sep 2024 09:45:12 -0700 Subject: [PATCH] fix(zetacore): add default cctx list pagination size --- x/crosschain/keeper/grpc_query_cctx.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/x/crosschain/keeper/grpc_query_cctx.go b/x/crosschain/keeper/grpc_query_cctx.go index a157a95433..fed1d3323d 100644 --- a/x/crosschain/keeper/grpc_query_cctx.go +++ b/x/crosschain/keeper/grpc_query_cctx.go @@ -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( @@ -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 {