From ce110681565354ba71ffe4c1113e1dfbc294cc12 Mon Sep 17 00:00:00 2001 From: ugurtafrali Date: Thu, 16 Apr 2026 14:15:48 +0300 Subject: [PATCH] Fix 400 error when querying blocks with no transactions --- sei-cosmos/x/auth/tx/service.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sei-cosmos/x/auth/tx/service.go b/sei-cosmos/x/auth/tx/service.go index 84fa7327a7..1345b7222d 100644 --- a/sei-cosmos/x/auth/tx/service.go +++ b/sei-cosmos/x/auth/tx/service.go @@ -198,7 +198,7 @@ func (s txServer) GetBlockWithTxs(ctx context.Context, req *txtypes.GetBlockWith blockTxs := block.Data.Txs blockTxsLn := uint64(len(blockTxs)) txs := make([]*txtypes.Tx, 0, limit) - if offset >= blockTxsLn { + if blockTxsLn > 0 && offset >= blockTxsLn { return nil, sdkerrors.ErrInvalidRequest.Wrapf("out of range: cannot paginate %d txs with offset %d and limit %d", blockTxsLn, offset, limit) } decodeTxAt := func(i uint64) error {