Skip to content

Commit 8abb6f3

Browse files
committed
fix: changed LIMIT in the transaction SQL query to the correct spot
1 parent 77071f7 commit 8abb6f3

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

indexer/src/kadena-server/repository/infra/query-builders/transaction-query-builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,6 @@ export default class TransactionQueryBuilder {
264264
FROM "Transactions" t
265265
${transactionsConditions}
266266
ORDER BY t.creationtime ${order}, t.id ${order}
267-
LIMIT $1
268267
)
269268
SELECT
270269
t.id AS id,
@@ -294,6 +293,7 @@ export default class TransactionQueryBuilder {
294293
JOIN "Blocks" b ON b.id = t."blockId"
295294
${params.isCoinbase ? 'LEFT ' : ''} JOIN "TransactionDetails" td ON t.id = td."transactionId"
296295
${blocksConditions}
296+
LIMIT $1
297297
`;
298298
}
299299

indexer/src/kadena-server/repository/infra/repository/transaction-db-repository.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ export default class TransactionDbRepository implements TransactionRepository {
484484
} = params;
485485

486486
const transactionsParams: (string | number)[] = [];
487-
const blockParams: (string | number)[] = [];
487+
const blockParams: (string | number | boolean)[] = [];
488488
let transactionsConditions = '';
489489
let blocksConditions = '';
490490

@@ -529,6 +529,10 @@ export default class TransactionDbRepository implements TransactionRepository {
529529
}
530530

531531
const paramsOffset = transactionsParams.length;
532+
533+
blockParams.push(true);
534+
blocksConditions += `\nWHERE b.canonical = $${paramsOffset + blockParams.length}`;
535+
532536
if (blockHash) {
533537
blockParams.push(blockHash);
534538
const op = localOperator(blockParams.length);

0 commit comments

Comments
 (0)