Skip to content

Commit eabe27b

Browse files
authored
fix: filter canonical txs correctly for account tx history (#1120)
* fix: filter canonical txs correctly * test: add result length check
1 parent 583c7e4 commit eabe27b

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/datastore/postgres-store.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5548,6 +5548,7 @@ export class PgDataStore
55485548
SELECT ${txColumns()}, ${abiColumn()}, count
55495549
FROM stx_txs
55505550
INNER JOIN txs USING (tx_id)
5551+
WHERE canonical = TRUE AND microblock_canonical = TRUE
55515552
`,
55525553
[args.stxAddress, args.limit, args.offset, args.blockHeight]
55535554
);

src/tests/api-tests.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2072,6 +2072,7 @@ describe('api tests', () => {
20722072
expect(result1.type).toBe('application/json');
20732073
const json1 = JSON.parse(result1.text);
20742074
expect(json1.total).toEqual(1);
2075+
expect(json1.results.length).toEqual(1);
20752076
expect(json1.results[0].tx_id).toEqual('0x123123');
20762077
expect(json1.results[0].block_height).toEqual(3);
20772078

0 commit comments

Comments
 (0)