From d71e93a54ec8018c15bbfc2f88d18bab6606949e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20C=C3=A1rdenas?= Date: Mon, 12 Feb 2024 15:04:14 -0600 Subject: [PATCH] feat: add `metadata` and `parent` columns to inscriptions table (#305) * chore: update client * feat: add columns * fix: tests --- migrations/1707770109739_metadata-parent.ts | 15 + package-lock.json | 14 +- package.json | 2 +- src/pg/helpers.ts | 2 + src/pg/pg-store.ts | 2 - src/pg/types.ts | 2 + tests/api/cache.test.ts | 35 +++ tests/api/inscriptions.test.ts | 290 ++++++++++++++++++++ tests/api/sats.test.ts | 15 + tests/api/stats.test.ts | 5 + tests/api/status.test.ts | 10 + tests/brc-20/brc20.test.ts | 6 + tests/helpers.ts | 5 + tests/ordhook/server.test.ts | 70 +++++ 14 files changed, 463 insertions(+), 10 deletions(-) create mode 100644 migrations/1707770109739_metadata-parent.ts diff --git a/migrations/1707770109739_metadata-parent.ts b/migrations/1707770109739_metadata-parent.ts new file mode 100644 index 00000000..0c33c976 --- /dev/null +++ b/migrations/1707770109739_metadata-parent.ts @@ -0,0 +1,15 @@ +/* eslint-disable @typescript-eslint/naming-convention */ +import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate'; + +export const shorthands: ColumnDefinitions | undefined = undefined; + +export function up(pgm: MigrationBuilder): void { + pgm.addColumns('inscriptions', { + metadata: { + type: 'text', + }, + parent: { + type: 'text', + }, + }); +} diff --git a/package-lock.json b/package-lock.json index 5681507e..869f446c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "@fastify/swagger": "^8.3.1", "@fastify/type-provider-typebox": "^3.2.0", "@hirosystems/api-toolkit": "^1.3.1", - "@hirosystems/chainhook-client": "^1.6.0", + "@hirosystems/chainhook-client": "^1.7.0", "@semantic-release/changelog": "^6.0.3", "@semantic-release/commit-analyzer": "^10.0.4", "@semantic-release/git": "^10.0.1", @@ -1299,9 +1299,9 @@ } }, "node_modules/@hirosystems/chainhook-client": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@hirosystems/chainhook-client/-/chainhook-client-1.6.0.tgz", - "integrity": "sha512-8skXF0Hk5XL5LH6enYySyuwEy3Kzn8AAb5+ERG0w9WSfehBNjLkL3zKJFuwg8Ov926YzE7a2ZnzlUpVmvvlulw==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@hirosystems/chainhook-client/-/chainhook-client-1.7.0.tgz", + "integrity": "sha512-XRSbpu+Bxwvd8qqQTNcomfO8RYu+Dpnl9ZnB8EJE+tvJ4y3lUZD6Uk65368Us0Hbw+VNWnU2ibej7iqB6mGsOA==", "dependencies": { "@fastify/type-provider-typebox": "^3.2.0", "fastify": "^4.15.0", @@ -19743,9 +19743,9 @@ } }, "@hirosystems/chainhook-client": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@hirosystems/chainhook-client/-/chainhook-client-1.6.0.tgz", - "integrity": "sha512-8skXF0Hk5XL5LH6enYySyuwEy3Kzn8AAb5+ERG0w9WSfehBNjLkL3zKJFuwg8Ov926YzE7a2ZnzlUpVmvvlulw==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@hirosystems/chainhook-client/-/chainhook-client-1.7.0.tgz", + "integrity": "sha512-XRSbpu+Bxwvd8qqQTNcomfO8RYu+Dpnl9ZnB8EJE+tvJ4y3lUZD6Uk65368Us0Hbw+VNWnU2ibej7iqB6mGsOA==", "requires": { "@fastify/type-provider-typebox": "^3.2.0", "fastify": "^4.15.0", diff --git a/package.json b/package.json index 61b642a5..6692d736 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "@fastify/swagger": "^8.3.1", "@fastify/type-provider-typebox": "^3.2.0", "@hirosystems/api-toolkit": "^1.3.1", - "@hirosystems/chainhook-client": "^1.6.0", + "@hirosystems/chainhook-client": "^1.7.0", "@semantic-release/changelog": "^6.0.3", "@semantic-release/commit-analyzer": "^10.0.4", "@semantic-release/git": "^10.0.1", diff --git a/src/pg/helpers.ts b/src/pg/helpers.ts index 4cef0600..25d5d504 100644 --- a/src/pg/helpers.ts +++ b/src/pg/helpers.ts @@ -114,6 +114,8 @@ function updateFromOrdhookInscriptionRevealed(args: { sat_rarity: satoshi.rarity, sat_coinbase_height: satoshi.blockHeight, recursive: recursive_refs.length > 0, + metadata: args.reveal.metadata ? JSON.stringify(args.reveal.metadata) : null, + parent: args.reveal.parent, }, location: { block_hash: args.block_hash, diff --git a/src/pg/pg-store.ts b/src/pg/pg-store.ts index ce4032be..cb16e755 100644 --- a/src/pg/pg-store.ts +++ b/src/pg/pg-store.ts @@ -26,10 +26,8 @@ import { DbInscriptionIndexFilters, DbInscriptionIndexOrder, DbInscriptionIndexPaging, - InscriptionData, DbInscriptionLocationChange, DbLocation, - RevealLocationData, DbLocationPointer, DbLocationPointerInsert, DbPaginatedResult, diff --git a/src/pg/types.ts b/src/pg/types.ts index d070c91d..46680b91 100644 --- a/src/pg/types.ts +++ b/src/pg/types.ts @@ -20,6 +20,8 @@ export type InscriptionData = { sat_rarity: string; sat_coinbase_height: number; recursive: boolean; + metadata: string | null; + parent: string | null; }; export type InscriptionInsert = InscriptionData; diff --git a/tests/api/cache.test.ts b/tests/api/cache.test.ts index da974352..9eca102e 100644 --- a/tests/api/cache.test.ts +++ b/tests/api/cache.test.ts @@ -45,6 +45,11 @@ describe('ETag cache', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build(); await db.updateInscriptions(block); @@ -180,6 +185,11 @@ describe('ETag cache', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build(); await db.updateInscriptions(block1); @@ -208,6 +218,11 @@ describe('ETag cache', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build(); await db.updateInscriptions(block2); @@ -283,6 +298,11 @@ describe('ETag cache', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build(); await db.updateInscriptions(block1); @@ -330,6 +350,11 @@ describe('ETag cache', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build(); await db.updateInscriptions(block2); @@ -369,6 +394,11 @@ describe('ETag cache', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build(); await db.updateInscriptions(block1); @@ -416,6 +446,11 @@ describe('ETag cache', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build(); await db.updateInscriptions(block2); diff --git a/tests/api/inscriptions.test.ts b/tests/api/inscriptions.test.ts index 0dbe1158..a9693510 100644 --- a/tests/api/inscriptions.test.ts +++ b/tests/api/inscriptions.test.ts @@ -54,6 +54,11 @@ describe('/inscriptions', () => { inscription_input_index: 0, transfers_pre_inscription: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -86,6 +91,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -163,6 +173,11 @@ describe('/inscriptions', () => { inscription_input_index: 0, transfers_pre_inscription: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .transaction({ hash: '0xf351d86c6e6cae3c64e297e7463095732f216875bcc1f3c03f950a492bb25421', @@ -185,6 +200,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -223,6 +243,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -303,6 +328,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -380,6 +410,11 @@ describe('/inscriptions', () => { inscription_input_index: 0, transfers_pre_inscription: 0, tx_index: 0, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -457,6 +492,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -602,6 +642,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -707,6 +752,11 @@ describe('/inscriptions', () => { inscription_input_index: 0, transfers_pre_inscription: 0, tx_index: 0, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -854,6 +904,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -1018,6 +1073,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .transaction({ hash: '7ac73ecd01b9da4a7eab904655416dbfe8e03f193e091761b5a63ad0963570cd', @@ -1040,6 +1100,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 1, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -1370,6 +1435,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -1402,6 +1472,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -1500,6 +1575,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -1532,6 +1612,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -1647,6 +1732,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -1679,6 +1769,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -1740,6 +1835,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -1772,6 +1872,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -1837,6 +1942,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -1869,6 +1979,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -1930,6 +2045,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -1962,6 +2082,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -2025,6 +2150,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -2070,6 +2200,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -2102,6 +2237,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -2149,6 +2289,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -2181,6 +2326,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -2236,6 +2386,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -2268,6 +2423,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -2323,6 +2483,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -2355,6 +2520,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -2410,6 +2580,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -2442,6 +2617,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -2496,6 +2676,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -2528,6 +2713,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -2563,6 +2753,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }; await db.updateInscriptions( new TestChainhookPayloadBuilder() @@ -2607,6 +2802,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -2766,6 +2966,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -2800,6 +3005,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -2859,6 +3069,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -2893,6 +3108,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: 'test', + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -2952,6 +3172,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -2983,6 +3208,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build(); await db.updateInscriptions(genesis2); @@ -3052,6 +3282,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -3084,6 +3319,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -3116,6 +3356,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -3173,6 +3418,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -3205,6 +3455,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -3237,6 +3492,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -3294,6 +3554,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -3326,6 +3591,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -3358,6 +3628,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -3415,6 +3690,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -3447,6 +3727,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -3479,6 +3764,11 @@ describe('/inscriptions', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); diff --git a/tests/api/sats.test.ts b/tests/api/sats.test.ts index 91b36b20..4747237a 100644 --- a/tests/api/sats.test.ts +++ b/tests/api/sats.test.ts @@ -63,6 +63,11 @@ describe('/sats', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -100,6 +105,11 @@ describe('/sats', () => { inscription_input_index: 0, transfers_pre_inscription: 0, tx_index: 0, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -132,6 +142,11 @@ describe('/sats', () => { inscription_input_index: 0, transfers_pre_inscription: 0, tx_index: 0, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); diff --git a/tests/api/stats.test.ts b/tests/api/stats.test.ts index 9215ee74..5f2b4c35 100644 --- a/tests/api/stats.test.ts +++ b/tests/api/stats.test.ts @@ -224,6 +224,11 @@ function testRevealApply(blockHeight: number, numbers: number[]) { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }); } return block.build(); diff --git a/tests/api/status.test.ts b/tests/api/status.test.ts index 2c79dc72..2cbabd39 100644 --- a/tests/api/status.test.ts +++ b/tests/api/status.test.ts @@ -55,6 +55,11 @@ describe('Status', () => { inscription_input_index: 0, transfers_pre_inscription: 0, tx_index: 0, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, curse_type: null, }) .build() @@ -82,6 +87,11 @@ describe('Status', () => { inscription_input_index: 0, transfers_pre_inscription: 0, tx_index: 0, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); diff --git a/tests/brc-20/brc20.test.ts b/tests/brc-20/brc20.test.ts index 3752d4d7..9f5a8608 100644 --- a/tests/brc-20/brc20.test.ts +++ b/tests/brc-20/brc20.test.ts @@ -102,6 +102,8 @@ describe('BRC-20', () => { sat_rarity: 'common', sat_coinbase_height: 110, recursive: false, + metadata: null, + parent: null, }; return insert; }; @@ -130,6 +132,8 @@ describe('BRC-20', () => { sat_rarity: 'common', sat_coinbase_height: 110, recursive: false, + metadata: null, + parent: null, }; expect(brc20FromInscription(insert)).toBeUndefined(); insert.content_type = 'application/json'; @@ -159,6 +163,8 @@ describe('BRC-20', () => { sat_rarity: 'common', sat_coinbase_height: 110, recursive: false, + metadata: null, + parent: null, }; expect(brc20FromInscription(insert)).toBeUndefined(); }); diff --git a/tests/helpers.ts b/tests/helpers.ts index e1f0087c..f26f86b3 100644 --- a/tests/helpers.ts +++ b/tests/helpers.ts @@ -137,6 +137,11 @@ export function brc20Reveal(args: { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: undefined, + parent: null, }; return reveal; } diff --git a/tests/ordhook/server.test.ts b/tests/ordhook/server.test.ts index efcacb15..cdc3a761 100644 --- a/tests/ordhook/server.test.ts +++ b/tests/ordhook/server.test.ts @@ -51,6 +51,11 @@ describe('EventServer', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }; // Apply @@ -169,6 +174,11 @@ describe('EventServer', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -306,6 +316,11 @@ describe('EventServer', () => { transfers_pre_inscription: 0, tx_index: 995, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .transaction({ hash: '7edaa48337a94da327b6262830505f116775a32db5ad4ad46e87ecea33f21bac', @@ -363,6 +378,11 @@ describe('EventServer', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -394,6 +414,11 @@ describe('EventServer', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build(); await expect(db.updateInscriptions(errorPayload)).rejects.toThrow(BadPayloadRequestError); @@ -436,6 +461,11 @@ describe('EventServer', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -467,6 +497,11 @@ describe('EventServer', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .transaction({ hash: '6891d374a17ba85f6b5514f2f7edc301c1c860284dff5a5c6e88ab3a20fcd8a5', @@ -489,6 +524,11 @@ describe('EventServer', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build(); await expect(db.updateInscriptions(errorPayload)).rejects.toThrow(BadPayloadRequestError); @@ -531,6 +571,11 @@ describe('EventServer', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() ); @@ -562,6 +607,11 @@ describe('EventServer', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .transaction({ hash: '6891d374a17ba85f6b5514f2f7edc301c1c860284dff5a5c6e88ab3a20fcd8a5', @@ -584,6 +634,11 @@ describe('EventServer', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build(); await expect(db.updateInscriptions(unboundPayload)).resolves.not.toThrow( @@ -620,6 +675,11 @@ describe('EventServer', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build(); await db.updateInscriptions(payload); @@ -666,6 +726,11 @@ describe('EventServer', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: { tag: 'x' }, + parent: null, }) .inscriptionRevealed({ content_bytes: '0x48656C6C6F', @@ -686,6 +751,11 @@ describe('EventServer', () => { transfers_pre_inscription: 0, tx_index: 0, curse_type: null, + inscription_pointer: null, + delegate: null, + metaprotocol: null, + metadata: null, + parent: null, }) .build() )