From 2dfb34915b1b5050e086ec80e905c2f35a93f517 Mon Sep 17 00:00:00 2001 From: Steven Lee Date: Mon, 15 Apr 2024 00:24:03 -0700 Subject: [PATCH] Refactor and add rune ticker (#41) --- index.ts | 44 +++++++----------------- package.json | 2 +- src/indexer/index.ts | 1 + src/indexer/types.ts | 6 ++-- src/indexer/updater.ts | 16 +++++---- test/updater.test.ts | 77 +++++++++++++++++++++++++++++++++++------- 6 files changed, 93 insertions(+), 53 deletions(-) diff --git a/index.ts b/index.ts index 082eb2a..d413a0f 100644 --- a/index.ts +++ b/index.ts @@ -25,14 +25,7 @@ export { RunestoneStorage, } from './src/indexer'; -export { Edict } from './src/edict'; -export { Etching } from './src/etching'; export { Network } from './src/network'; -export { Rune } from './src/rune'; -export { SpacedRune } from './src/spacedrune'; -export { RuneId } from './src/runeid'; -export { Runestone } from './src/runestone'; -export { Terms } from './src/terms'; export { BitcoinRpcClient, @@ -101,9 +94,9 @@ const SPACERS = ['•', '.']; * @returns encoded runestone bytes * @throws Error if encoding is detected to be considered a cenotaph */ -export function encodeRunestoneUnsafe(runestone: RunestoneSpec): { - encodedRune: Buffer; - etchingCommitment: Buffer | undefined; +export function encodeRunestone(runestone: RunestoneSpec): { + encodedRunestone: Buffer; + etchingCommitment?: Buffer; } { const mint = runestone.mint ? Some(new RuneId(u64Strict(runestone.mint.block), u32Strict(runestone.mint.tx))) @@ -121,25 +114,11 @@ export function encodeRunestoneUnsafe(runestone: RunestoneSpec): { let etchingCommitment: Buffer | undefined = undefined; if (runestone.etching) { const etchingSpec = runestone.etching; - let hasSpacers = false; - for (const spacer of SPACERS) { - if (runestone.etching?.rune?.includes(spacer)) { - hasSpacers = true; - break; - } - } - let runeSpacers: number | undefined = undefined; - let parsedRawRune: Rune | undefined = undefined; - if (hasSpacers) { - const spacedRune = etchingSpec.rune ? SpacedRune.fromString(etchingSpec.rune) : undefined; - runeSpacers = spacedRune?.spacers; - parsedRawRune = spacedRune?.rune; - } else { - parsedRawRune = etchingSpec.rune ? Rune.fromString(etchingSpec.rune) : undefined; - } - const rune: Option = - parsedRawRune !== undefined ? Some(parsedRawRune).map(() => parsedRawRune!) : None; + const spacedRune = etchingSpec.runeName + ? SpacedRune.fromString(etchingSpec.runeName) + : undefined; + const rune = spacedRune?.rune !== undefined ? Some(spacedRune.rune) : None; if ( etchingSpec.symbol && @@ -155,7 +134,10 @@ export function encodeRunestoneUnsafe(runestone: RunestoneSpec): { etchingSpec.divisibility !== undefined ? Some(etchingSpec.divisibility).map(u8Strict) : None; const premine = etchingSpec.premine !== undefined ? Some(etchingSpec.premine).map(u128Strict) : None; - const spacers: Option = hasSpacers && runeSpacers ? Some(u32Strict(runeSpacers)) : None; + const spacers = + spacedRune?.spacers !== undefined && spacedRune.spacers !== 0 + ? Some(u32Strict(spacedRune.spacers)) + : None; const symbol = etchingSpec.symbol ? Some(etchingSpec.symbol) : None; if (divisibility.isSome() && divisibility.unwrap() > MAX_DIVISIBILITY) { @@ -195,11 +177,11 @@ export function encodeRunestoneUnsafe(runestone: RunestoneSpec): { const turbo = etchingSpec.turbo ?? false; etching = Some(new Etching(divisibility, rune, spacers, symbol, terms, premine, turbo)); - etchingCommitment = (parsedRawRune as Rune)?.commitment; + etchingCommitment = rune.isSome() ? rune.unwrap().commitment : undefined; } return { - encodedRune: new Runestone(mint, pointer, edicts, etching).encipher(), + encodedRunestone: new Runestone(mint, pointer, edicts, etching).encipher(), etchingCommitment, }; } diff --git a/package.json b/package.json index 0bf6570..2df64ed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@magiceden-oss/runestone-lib", - "version": "0.6.2-alpha", + "version": "0.7.0-alpha", "description": "", "main": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/src/indexer/index.ts b/src/indexer/index.ts index bde93b3..283ff25 100644 --- a/src/indexer/index.ts +++ b/src/indexer/index.ts @@ -40,6 +40,7 @@ export class RunestoneIndexer { if (this._network === Network.MAINNET) { this._storage.seedEtchings([ { + runeTicker: 'UNCOMMONGOODS', runeName: 'UNCOMMON•GOODS', runeId: { block: 1, tx: 0 }, txid: '0000000000000000000000000000000000000000000000000000000000000000', diff --git a/src/indexer/types.ts b/src/indexer/types.ts index f29d7de..5ee50a5 100644 --- a/src/indexer/types.ts +++ b/src/indexer/types.ts @@ -55,7 +55,7 @@ export interface RunestoneStorage { */ getValidMintCount(runeLocation: string, blockhash: string): Promise; - getRuneLocation(rune: string): Promise; + getRuneLocation(runeTicker: string): Promise; /** * Get the rune balances for the given UTXO. @@ -112,6 +112,7 @@ export type RuneUtxoBalance = { scriptPubKey: Buffer; runeId: RuneLocation; runeName: string; + runeTicker: string; amount: bigint; }; @@ -137,11 +138,12 @@ export type RuneEtchingBase = { turbo?: boolean; }; -export type RuneEtchingSpec = RuneEtchingBase & { rune?: string }; +export type RuneEtchingSpec = RuneEtchingBase & { runeName?: string }; export type RuneEtching = ({ valid: false } | ({ valid: true } & RuneEtchingBase)) & { runeId: RuneLocation; runeName: string; + runeTicker: string; txid: string; }; diff --git a/src/indexer/updater.ts b/src/indexer/updater.ts index 618b8c8..08dd333 100644 --- a/src/indexer/updater.ts +++ b/src/indexer/updater.ts @@ -273,21 +273,21 @@ export class RuneUpdater implements RuneBlockIndex { continue; } - const runeNameByRuneId = new Map( - this.etchings.map((etching) => [RuneLocation.toString(etching.runeId), etching.runeName]) + const etchingByRuneId = new Map( + this.etchings.map((etching) => [RuneLocation.toString(etching.runeId), etching]) ); for (const balance of balances.values()) { const runeIdString = RuneLocation.toString(balance.runeId); - const runeName = - runeNameByRuneId.get(runeIdString) ?? - (await this._storage.getEtching(runeIdString))?.runeName; - if (runeName === undefined) { + const etching = + etchingByRuneId.get(runeIdString) ?? (await this._storage.getEtching(runeIdString)); + if (etching === null) { throw new Error('Rune should exist at this point'); } this.utxoBalances.push({ runeId: balance.runeId, - runeName, + runeTicker: etching.runeTicker, + runeName: etching.runeName, amount: balance.amount, scriptPubKey: Buffer.from(output.scriptPubKey.hex), txid: tx.txid, @@ -512,6 +512,7 @@ export class RuneUpdater implements RuneBlockIndex { const { divisibility, terms, premine, spacers, symbol } = artifact.etching.unwrap(); this.etchings.push({ valid: true, + runeTicker: rune.toString(), runeName: new SpacedRune(rune, Number(spacers.map(Number).unwrapOr(0))).toString(), runeId, txid, @@ -563,6 +564,7 @@ export class RuneUpdater implements RuneBlockIndex { valid: false, runeId, txid, + runeTicker: rune.toString(), runeName: rune.toString(), }); } diff --git a/test/updater.test.ts b/test/updater.test.ts index 4c02d59..0ab4588 100644 --- a/test/updater.test.ts +++ b/test/updater.test.ts @@ -181,7 +181,7 @@ describe('deploy', () => { await runeUpdater.indexRunes(tx, 88); expect(runeUpdater.etchings.length).toBe(1); - expect(runeUpdater.etchings[0]).toMatchObject({ valid: true, rune: 'AAAAAAAAAAAAAA' }); + expect(runeUpdater.etchings[0]).toMatchObject({ valid: true, runeTicker: 'AAAAAAAAAAAAAA' }); }); test('deploy is successful due to no commitment and rune unspecified', async () => { @@ -196,7 +196,7 @@ describe('deploy', () => { expect(runeUpdater.etchings.length).toBe(1); expect(runeUpdater.etchings[0]).toMatchObject({ valid: true, - rune: 'AAAAAAAAAAAAAAAADBCSMALNGCU', + runeTicker: 'AAAAAAAAAAAAAAAADBCSMALNGCU', }); }); @@ -229,7 +229,7 @@ describe('deploy', () => { expect(runeUpdater.etchings.length).toBe(1); expect(runeUpdater.etchings[0]).toMatchObject({ valid: false, - rune: 'AAAAAAAAAAAAAA', + runeTicker: 'AAAAAAAAAAAAAA', }); }); @@ -257,7 +257,7 @@ describe('deploy', () => { expect(runeUpdater.utxoBalances[0]).toMatchObject({ txid: 'txid', vout: 1, - rune: 'AAAAAAAAAAAAAAAADBCSMALNGCU', + runeTicker: 'AAAAAAAAAAAAAAAADBCSMALNGCU', runeId: { block: 100000, tx: 88, @@ -296,7 +296,7 @@ describe('deploy', () => { expect(runeUpdater.utxoBalances[0]).toMatchObject({ txid: 'txid', vout: 1, - rune: 'AAAAAAAAAAAAAAAADBCSMALNGCU', + runeTicker: 'AAAAAAAAAAAAAAAADBCSMALNGCU', runeId: { block: 100000, tx: 88, @@ -306,7 +306,7 @@ describe('deploy', () => { expect(runeUpdater.utxoBalances[1]).toMatchObject({ txid: 'txid', vout: 2, - rune: 'AAAAAAAAAAAAAAAADBCSMALNGCU', + runeTicker: 'AAAAAAAAAAAAAAAADBCSMALNGCU', runeId: { block: 100000, tx: 88, @@ -316,7 +316,7 @@ describe('deploy', () => { expect(runeUpdater.utxoBalances[2]).toMatchObject({ txid: 'txid', vout: 3, - rune: 'AAAAAAAAAAAAAAAADBCSMALNGCU', + runeTicker: 'AAAAAAAAAAAAAAAADBCSMALNGCU', runeId: { block: 100000, tx: 88, @@ -349,7 +349,7 @@ describe('deploy', () => { expect(runeUpdater.utxoBalances[0]).toMatchObject({ txid: 'txid', vout: 1, - rune: 'AAAAAAAAAAAAAAAADBCSMALNGCU', + runeTicker: 'AAAAAAAAAAAAAAAADBCSMALNGCU', runeId: { block: 100000, tx: 88, @@ -385,7 +385,7 @@ describe('deploy', () => { expect(runeUpdater.utxoBalances[0]).toMatchObject({ txid: 'txid', vout: 1, - rune: 'AAAAAAAAAAAAAAAADBCSMALNGCU', + runeTicker: 'AAAAAAAAAAAAAAAADBCSMALNGCU', runeId: { block: 100000, tx: 88, @@ -422,7 +422,7 @@ describe('deploy', () => { expect(runeUpdater.utxoBalances[0]).toMatchObject({ txid: 'txid', vout: 1, - rune: 'AAAAAAAAAAAAAAAADBCSMALNGCU', + runeTicker: 'AAAAAAAAAAAAAAAADBCSMALNGCU', runeId: { block: 100000, tx: 88, @@ -432,7 +432,7 @@ describe('deploy', () => { expect(runeUpdater.utxoBalances[1]).toMatchObject({ txid: 'txid', vout: 2, - rune: 'AAAAAAAAAAAAAAAADBCSMALNGCU', + runeTicker: 'AAAAAAAAAAAAAAAADBCSMALNGCU', runeId: { block: 100000, tx: 88, @@ -465,6 +465,7 @@ describe('mint', () => { storage.getEtching.mockResolvedValue({ valid: true, txid: 'txid', + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, terms: { amount: 100n, cap: 1n }, @@ -476,6 +477,7 @@ describe('mint', () => { expect(runeUpdater.utxoBalances[0]).toMatchObject({ txid: 'txid', vout: 1, + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 876543, @@ -518,6 +520,7 @@ describe('mint', () => { storage.getEtching.mockResolvedValue({ valid: true, txid: 'txid', + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, terms: { amount: 100n, cap: 1n, [heightType]: { [checkType]: checkValue } }, @@ -530,6 +533,7 @@ describe('mint', () => { expect(runeUpdater.utxoBalances[0]).toMatchObject({ txid: 'txid', vout: 1, + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 876543, @@ -568,6 +572,7 @@ describe('mint', () => { storage.getEtching.mockResolvedValue({ valid: true, txid: 'txid', + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, terms: { amount: 100n, cap: 3n }, @@ -580,6 +585,7 @@ describe('mint', () => { expect(runeUpdater.utxoBalances[0]).toMatchObject({ txid: 'txid', vout: 1, + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 876543, @@ -620,6 +626,7 @@ describe('mint', () => { storage.getEtching.mockResolvedValue({ valid: true, txid: 'txid', + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, terms: { amount: 100n, cap: 1n }, @@ -631,6 +638,7 @@ describe('mint', () => { expect(runeUpdater.utxoBalances[0]).toMatchObject({ txid: 'txid', vout: 1, + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 876543, @@ -667,6 +675,7 @@ describe('mint', () => { storage.getEtching.mockResolvedValue({ valid: true, txid: 'txid', + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, terms: { amount: 100n, cap: 1n }, @@ -678,6 +687,7 @@ describe('mint', () => { expect(runeUpdater.utxoBalances[0]).toMatchObject({ txid: 'txid', vout: 1, + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 876543, @@ -688,6 +698,7 @@ describe('mint', () => { expect(runeUpdater.utxoBalances[1]).toMatchObject({ txid: 'txid', vout: 2, + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 876543, @@ -742,7 +753,7 @@ test('mint is valid for etching in same block', async () => { expect(runeUpdater.utxoBalances[0]).toMatchObject({ txid: 'txid2', vout: 1, - rune: 'AAAAAAAAAAAAAAAADBCSMALNGAF', + runeTicker: 'AAAAAAAAAAAAAAAADBCSMALNGAF', runeId: { block: 100000, tx: 21, @@ -781,6 +792,7 @@ describe('edict', () => { txid: 'parenttxid', vout: 0, amount: 400n, + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'), @@ -792,6 +804,7 @@ describe('edict', () => { txid: 'parenttxid', vout: 1, amount: 89n, + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'), @@ -801,6 +814,7 @@ describe('edict', () => { storage.getEtching.mockResolvedValue({ valid: true, txid: 'txid', + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, terms: { amount: 500n, cap: 1n }, @@ -812,6 +826,7 @@ describe('edict', () => { expect(runeUpdater.utxoBalances[0]).toMatchObject({ txid: 'txid', vout: 1, + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, @@ -822,6 +837,7 @@ describe('edict', () => { expect(runeUpdater.utxoBalances[1]).toMatchObject({ txid: 'txid', vout: 2, + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, @@ -856,6 +872,7 @@ describe('edict', () => { txid: 'parenttxid', vout: 0, amount: 400n, + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'), @@ -866,6 +883,7 @@ describe('edict', () => { storage.getEtching.mockResolvedValue({ valid: true, txid: 'txid', + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, terms: { amount: 500n, cap: 1n }, @@ -878,6 +896,7 @@ describe('edict', () => { expect(runeUpdater.utxoBalances[0]).toMatchObject({ txid: 'txid', vout: 1, + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, @@ -888,6 +907,7 @@ describe('edict', () => { expect(runeUpdater.utxoBalances[1]).toMatchObject({ txid: 'childtxid', vout: 0, + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, @@ -922,6 +942,7 @@ describe('edict', () => { txid: 'parenttxid', vout: 0, amount: 400n, + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'), @@ -932,6 +953,7 @@ describe('edict', () => { storage.getEtching.mockResolvedValue({ valid: true, txid: 'txid', + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, terms: { amount: 400n, cap: 1n }, @@ -969,6 +991,7 @@ describe('edict', () => { txid: 'parenttxid', vout: 0, amount: 400n, + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'), @@ -979,6 +1002,7 @@ describe('edict', () => { storage.getEtching.mockResolvedValue({ valid: true, txid: 'txid', + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, terms: { amount: 400n, cap: 1n }, @@ -990,6 +1014,7 @@ describe('edict', () => { expect(runeUpdater.utxoBalances[0]).toMatchObject({ txid: 'txid', vout: 1, + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, @@ -1020,6 +1045,7 @@ describe('edict', () => { txid: 'parenttxid', vout: 0, amount: 400n, + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'), @@ -1030,6 +1056,7 @@ describe('edict', () => { storage.getEtching.mockResolvedValue({ valid: true, txid: 'txid', + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, terms: { amount: 400n, cap: 1n }, @@ -1041,6 +1068,7 @@ describe('edict', () => { expect(runeUpdater.utxoBalances[0]).toMatchObject({ txid: 'txid', vout: 2, + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, @@ -1075,6 +1103,7 @@ describe('edict', () => { txid: 'parenttxid', vout: 0, amount: 400n, + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'), @@ -1085,6 +1114,7 @@ describe('edict', () => { storage.getEtching.mockResolvedValue({ valid: true, txid: 'txid', + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, terms: { amount: 400n, cap: 1n }, @@ -1097,6 +1127,7 @@ describe('edict', () => { expect(runeUpdater.utxoBalances[i]).toMatchObject({ txid: 'txid', vout: i + 1, + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, @@ -1132,6 +1163,7 @@ describe('edict', () => { txid: 'parenttxid', vout: 0, amount: 402n, + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'), @@ -1142,6 +1174,7 @@ describe('edict', () => { storage.getEtching.mockResolvedValue({ valid: true, txid: 'txid', + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, terms: { amount: 402n, cap: 1n }, @@ -1154,6 +1187,7 @@ describe('edict', () => { expect(runeUpdater.utxoBalances[i]).toMatchObject({ txid: 'txid', vout: i + 1, + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, @@ -1192,6 +1226,7 @@ describe('edict', () => { txid: 'parenttxid', vout: 0, amount: 500n, + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'), @@ -1202,6 +1237,7 @@ describe('edict', () => { storage.getEtching.mockResolvedValue({ valid: true, txid: 'txid', + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, terms: { amount: 500n, cap: 1n }, @@ -1214,6 +1250,7 @@ describe('edict', () => { expect(runeUpdater.utxoBalances[i]).toMatchObject({ txid: 'txid', vout: i + 1, + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, @@ -1249,6 +1286,7 @@ describe('edict', () => { txid: 'parenttxid', vout: 0, amount: 400n, + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'), @@ -1259,6 +1297,7 @@ describe('edict', () => { storage.getEtching.mockResolvedValue({ valid: true, txid: 'txid', + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, terms: { amount: 400n, cap: 1n }, @@ -1271,6 +1310,7 @@ describe('edict', () => { expect(runeUpdater.utxoBalances[i]).toMatchObject({ txid: 'txid', vout: i + 1, + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, @@ -1306,6 +1346,7 @@ describe('edict', () => { txid: 'parenttxid', vout: 0, amount: 400n, + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'), @@ -1316,6 +1357,7 @@ describe('edict', () => { storage.getEtching.mockResolvedValue({ valid: true, txid: 'txid', + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, terms: { amount: 400n, cap: 1n }, @@ -1328,6 +1370,7 @@ describe('edict', () => { expect(runeUpdater.utxoBalances[i]).toMatchObject({ txid: 'txid', vout: i + 1, + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, @@ -1360,6 +1403,7 @@ describe('no runestone', () => { txid: 'parenttxid', vout: 0, amount: 400n, + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'), @@ -1369,6 +1413,7 @@ describe('no runestone', () => { storage.getEtching.mockResolvedValue({ valid: true, txid: 'txid', + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, terms: { amount: 400n, cap: 1n }, @@ -1380,6 +1425,7 @@ describe('no runestone', () => { expect(runeUpdater.utxoBalances[0]).toMatchObject({ txid: 'txid', vout: 0, + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, @@ -1409,6 +1455,7 @@ describe('no runestone', () => { txid: 'parenttxid', vout: 0, amount: 400n, + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'), @@ -1418,6 +1465,7 @@ describe('no runestone', () => { storage.getEtching.mockResolvedValue({ valid: true, txid: 'txid', + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, terms: { amount: 400n, cap: 1n }, @@ -1429,6 +1477,7 @@ describe('no runestone', () => { expect(runeUpdater.utxoBalances[0]).toMatchObject({ txid: 'txid', vout: 1, + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, @@ -1465,6 +1514,7 @@ describe('burning', () => { txid: 'parenttxid', vout: 0, amount: 400n, + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'), @@ -1474,6 +1524,7 @@ describe('burning', () => { storage.getEtching.mockResolvedValue({ valid: true, txid: 'txid', + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, terms: { amount: 400n, cap: 1n }, @@ -1516,6 +1567,7 @@ describe('burning', () => { txid: 'parenttxid', vout: 0, amount: 400n, + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'), @@ -1525,6 +1577,7 @@ describe('burning', () => { storage.getEtching.mockResolvedValue({ valid: true, txid: 'txid', + runeTicker: 'TESTRUNE', runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, terms: { amount: 400n, cap: 1n },