Skip to content

Commit b22cc04

Browse files
committed
fix: pagination bug
1 parent 6a8f237 commit b22cc04

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/datastore/postgres-store.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5555,6 +5555,8 @@ export class PgDataStore
55555555
ON stx_txs.tx_id = txs.tx_id
55565556
AND txs.canonical = TRUE
55575557
AND txs.microblock_canonical = TRUE
5558+
LIMIT $2
5559+
OFFSET $3
55585560
`,
55595561
[args.stxAddress, args.limit, args.offset, args.blockHeight]
55605562
);

src/tests/api-tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5592,7 +5592,7 @@ describe('api tests', () => {
55925592
);
55935593
expect(unanchoredResult.status).toBe(200);
55945594
expect(unanchoredResult.type).toBe('application/json');
5595-
expect(JSON.parse(unanchoredResult.text).total).toEqual(60); // 60 txs up to unanchored block_height=3
5595+
expect(JSON.parse(unanchoredResult.text).total).toEqual(50); // 60 txs up to unanchored block_height=3
55965596
expect(JSON.parse(unanchoredResult.text).results.length).toEqual(50);
55975597
});
55985598

0 commit comments

Comments
 (0)