Skip to content

Commit

Permalink
fix: inscription number filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelcr committed Mar 2, 2023
1 parent 5698ebc commit adb5cf6
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/pg/pg-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ export class PgStore extends BasePgStore {
${
args.to_sat_ordinal ? this.sql`AND loc.sat_ordinal <= ${args.to_sat_ordinal}` : this.sql``
}
${args.number ? this.sql`AND i.number = ${args.number}` : this.sql``}
${args.address ? this.sql`AND loc.address = ${args.address}` : this.sql``}
${
args.mime_type?.length
Expand Down
27 changes: 27 additions & 0 deletions tests/inscriptions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,33 @@ describe('/inscriptions', () => {
});

test('shows inscription', async () => {
await db.insertInscriptionGenesis({
inscription: {
genesis_id: '9f4a9b73b0713c5da01c0a47f97c6c001af9028d6bdd9e264dfacbc4e6790201i0',
mime_type: 'text/plain',
content_type: 'text/plain;charset=utf-8',
content_length: 5,
number: 188,
content: '0x48656C6C6F',
fee: 705n,
},
location: {
inscription_id: 0,
block_height: 778575,
block_hash: '00000000000000000002a90330a99f67e3f01eb2ce070b45930581e82fb7a91d',
tx_id: '9f4a9b73b0713c5da01c0a47f97c6c001af9028d6bdd9e264dfacbc4e6790201',
address: 'bc1pscktlmn99gyzlvymvrezh6vwd0l4kg06tg5rvssw0czg8873gz5sdkteqj',
output: '9f4a9b73b0713c5da01c0a47f97c6c001af9028d6bdd9e264dfacbc4e6790201:0',
offset: 0n,
value: 10000n,
timestamp: 1676913207,
sat_ordinal: 257418248345364n,
sat_rarity: 'common',
sat_coinbase_height: 650000,
genesis: true,
current: true,
},
});
await db.insertInscriptionGenesis({
inscription: {
genesis_id: '38c46a8bf7ec90bc7f6b797e7dc84baa97f4e5fd4286b92fe1b50176d03b18dci0',
Expand Down

0 comments on commit adb5cf6

Please sign in to comment.