From e94b27db0d2d28b8fa9d2f148ba47c534dd280b9 Mon Sep 17 00:00:00 2001 From: Rafael Cardenas Date: Sat, 15 Jun 2024 21:02:36 -0600 Subject: [PATCH] fix: turn off block hash and output for now --- src/pg/pg-store.ts | 8 ++++---- tests/api/inscriptions.test.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pg/pg-store.ts b/src/pg/pg-store.ts index 422afaf..d1ff448 100644 --- a/src/pg/pg-store.ts +++ b/src/pg/pg-store.ts @@ -545,9 +545,9 @@ export class PgStore extends BasePgStore { : sql`` } ${ - filters?.genesis_block_hash + /*filters?.genesis_block_hash ? sql`AND gen_l.block_hash = ${filters.genesis_block_hash}` - : sql`` + :*/ sql`` } ${ filters?.from_genesis_block_height @@ -600,7 +600,7 @@ export class PgStore extends BasePgStore { ${ filters?.mime_type?.length ? sql`AND i.mime_type IN ${sql(filters.mime_type)}` : sql`` } - ${filters?.output ? sql`AND cur_l.output = ${filters.output}` : sql``} + ${/*filters?.output ? sql`AND cur_l.output = ${filters.output}` : */ sql``} ${filters?.sat_rarity?.length ? sql`AND s.rarity IN ${sql(filters.sat_rarity)}` : sql``} ${filters?.sat_ordinal ? sql`AND i.ordinal_number = ${filters.sat_ordinal}` : sql``} ${ @@ -630,7 +630,7 @@ export class PgStore extends BasePgStore { ORDER BY r.row_num ASC `; return { - total: total ?? results[0].total, + total: total ?? results[0]?.total ?? 0, results: results ?? [], }; }); diff --git a/tests/api/inscriptions.test.ts b/tests/api/inscriptions.test.ts index d52d4ed..15a43d3 100644 --- a/tests/api/inscriptions.test.ts +++ b/tests/api/inscriptions.test.ts @@ -2318,7 +2318,7 @@ describe('/inscriptions', () => { expect(responseJson4.results[1].genesis_block_height).toBe(778575); }); - test('index filtered by block hash', async () => { + test.skip('index filtered by block hash', async () => { await db.updateInscriptions( new TestChainhookPayloadBuilder() .apply() @@ -2794,7 +2794,7 @@ describe('/inscriptions', () => { expect(responseJson3.results[0].number).toBe(0); }); - test('index filtered by output', async () => { + test.skip('index filtered by output', async () => { await db.updateInscriptions( new TestChainhookPayloadBuilder() .apply()