Skip to content

Commit

Permalink
update naming
Browse files Browse the repository at this point in the history
  • Loading branch information
me-rob committed Apr 21, 2024
1 parent d8ecb2f commit 71cf6cf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/indexer/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,6 @@ export type RuneBlockIndex = {
etchings: RuneEtching[];
mintCounts: RuneMintCount[];
utxoBalances: RuneUtxoBalance[];
spentOutputs: SpentRuneUtxoBalance[];
spentBalances: SpentRuneUtxoBalance[];
burnedBalances: RuneBalance[];
};
4 changes: 2 additions & 2 deletions src/indexer/updater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, RuneMintCount> = new Map();
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions test/updater.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -903,7 +903,7 @@ describe('edict', () => {
},
amount: 400n,
});
expect(runeUpdater.spentOutputs[0]).toMatchObject({
expect(runeUpdater.spentBalances[0]).toMatchObject({
txid: 'parenttxid',
vout: 0,
address: '3P4WqXDbSLRhzo2H6MT6YFbvBKBDPLbVtQ',
Expand All @@ -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',
Expand Down

0 comments on commit 71cf6cf

Please sign in to comment.