From 71cf6cf33d315bcd1074fb49cefb5e20e32576ef Mon Sep 17 00:00:00 2001 From: Robert Wei Date: Sun, 21 Apr 2024 18:09:06 -0400 Subject: [PATCH] update naming --- src/indexer/types.ts | 2 +- src/indexer/updater.ts | 4 ++-- test/updater.test.ts | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/indexer/types.ts b/src/indexer/types.ts index 42a745e..267ea56 100644 --- a/src/indexer/types.ts +++ b/src/indexer/types.ts @@ -153,6 +153,6 @@ export type RuneBlockIndex = { etchings: RuneEtching[]; mintCounts: RuneMintCount[]; utxoBalances: RuneUtxoBalance[]; - spentOutputs: SpentRuneUtxoBalance[]; + spentBalances: SpentRuneUtxoBalance[]; burnedBalances: RuneBalance[]; }; diff --git a/src/indexer/updater.ts b/src/indexer/updater.ts index f07ff4c..395e716 100644 --- a/src/indexer/updater.ts +++ b/src/indexer/updater.ts @@ -39,7 +39,7 @@ export class RuneUpdater implements RuneBlockIndex { block: BlockInfo; etchings: RuneEtching[] = []; utxoBalances: RuneUtxoBalance[] = []; - spentOutputs: SpentRuneUtxoBalance[] = []; + spentBalances: SpentRuneUtxoBalance[] = []; private _minimum: Rune; private _mintCountsByRuneLocation: Map = new Map(); @@ -452,7 +452,7 @@ export class RuneUpdater implements RuneBlockIndex { const balance = unallocated.get(runeLocation) ?? { runeId, amount: 0n }; unallocated.set(runeLocation, balance); balance.amount = u128.checkedAddThrow(u128(balance.amount), u128(additionalBalance.amount)); - this.spentOutputs.push({ + this.spentBalances.push({ txid: input.txid, vout: input.vout, address: additionalBalance.address, diff --git a/test/updater.test.ts b/test/updater.test.ts index 0aa7c7c..eebf79f 100644 --- a/test/updater.test.ts +++ b/test/updater.test.ts @@ -882,7 +882,7 @@ describe('edict', () => { await runeUpdater.indexRunes(tx2, 89); expect(runeUpdater.etchings.length).toBe(0); expect(runeUpdater.utxoBalances.length).toBe(2); - expect(runeUpdater.spentOutputs.length).toBe(2); + expect(runeUpdater.spentBalances.length).toBe(2); expect(runeUpdater.utxoBalances[0]).toMatchObject({ txid: 'txid', vout: 1, @@ -903,7 +903,7 @@ describe('edict', () => { }, amount: 400n, }); - expect(runeUpdater.spentOutputs[0]).toMatchObject({ + expect(runeUpdater.spentBalances[0]).toMatchObject({ txid: 'parenttxid', vout: 0, address: '3P4WqXDbSLRhzo2H6MT6YFbvBKBDPLbVtQ', @@ -916,7 +916,7 @@ describe('edict', () => { amount: 400n, mempoolTxid: 'txid', }); - expect(runeUpdater.spentOutputs[1]).toMatchObject({ + expect(runeUpdater.spentBalances[1]).toMatchObject({ txid: 'txid', vout: 1, address: '3P4WqXDbSLRhzo2H6MT6YFbvBKBDPLbVtQ',