Skip to content

Commit

Permalink
Remove the need for runeName for RuneUtxoBalance (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
summraznboi authored Apr 15, 2024
1 parent 2dfb349 commit 669c472
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 38 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@magiceden-oss/runestone-lib",
"version": "0.7.0-alpha",
"version": "0.7.1-alpha",
"description": "",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
3 changes: 1 addition & 2 deletions src/indexer/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ export type RuneUtxoBalance = {
address?: string;
scriptPubKey: Buffer;
runeId: RuneLocation;
runeName: string;
runeTicker: string;
amount: bigint;
};
Expand Down Expand Up @@ -142,8 +141,8 @@ export type RuneEtchingSpec = RuneEtchingBase & { runeName?: string };

export type RuneEtching = ({ valid: false } | ({ valid: true } & RuneEtchingBase)) & {
runeId: RuneLocation;
runeName: string;
runeTicker: string;
runeName: string;
txid: string;
};

Expand Down
1 change: 0 additions & 1 deletion src/indexer/updater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,6 @@ export class RuneUpdater implements RuneBlockIndex {
this.utxoBalances.push({
runeId: balance.runeId,
runeTicker: etching.runeTicker,
runeName: etching.runeName,
amount: balance.amount,
scriptPubKey: Buffer.from(output.scriptPubKey.hex),
txid: tx.txid,
Expand Down
34 changes: 0 additions & 34 deletions test/updater.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,6 @@ describe('mint', () => {
txid: 'txid',
vout: 1,
runeTicker: 'TESTRUNE',
runeName: 'TESTRUNE',
runeId: {
block: 876543,
tx: 21,
Expand Down Expand Up @@ -534,7 +533,6 @@ describe('mint', () => {
txid: 'txid',
vout: 1,
runeTicker: 'TESTRUNE',
runeName: 'TESTRUNE',
runeId: {
block: 876543,
tx: 21,
Expand Down Expand Up @@ -586,7 +584,6 @@ describe('mint', () => {
txid: 'txid',
vout: 1,
runeTicker: 'TESTRUNE',
runeName: 'TESTRUNE',
runeId: {
block: 876543,
tx: 21,
Expand Down Expand Up @@ -639,7 +636,6 @@ describe('mint', () => {
txid: 'txid',
vout: 1,
runeTicker: 'TESTRUNE',
runeName: 'TESTRUNE',
runeId: {
block: 876543,
tx: 21,
Expand Down Expand Up @@ -688,7 +684,6 @@ describe('mint', () => {
txid: 'txid',
vout: 1,
runeTicker: 'TESTRUNE',
runeName: 'TESTRUNE',
runeId: {
block: 876543,
tx: 21,
Expand All @@ -699,7 +694,6 @@ describe('mint', () => {
txid: 'txid',
vout: 2,
runeTicker: 'TESTRUNE',
runeName: 'TESTRUNE',
runeId: {
block: 876543,
tx: 21,
Expand Down Expand Up @@ -793,7 +787,6 @@ describe('edict', () => {
vout: 0,
amount: 400n,
runeTicker: 'TESTRUNE',
runeName: 'TESTRUNE',
runeId: { block: 888, tx: 8 },
scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'),
address: '3P4WqXDbSLRhzo2H6MT6YFbvBKBDPLbVtQ',
Expand All @@ -805,7 +798,6 @@ describe('edict', () => {
vout: 1,
amount: 89n,
runeTicker: 'TESTRUNE',
runeName: 'TESTRUNE',
runeId: { block: 888, tx: 8 },
scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'),
address: '3P4WqXDbSLRhzo2H6MT6YFbvBKBDPLbVtQ',
Expand All @@ -827,7 +819,6 @@ describe('edict', () => {
txid: 'txid',
vout: 1,
runeTicker: 'TESTRUNE',
runeName: 'TESTRUNE',
runeId: {
block: 888,
tx: 8,
Expand All @@ -838,7 +829,6 @@ describe('edict', () => {
txid: 'txid',
vout: 2,
runeTicker: 'TESTRUNE',
runeName: 'TESTRUNE',
runeId: {
block: 888,
tx: 8,
Expand Down Expand Up @@ -873,7 +863,6 @@ describe('edict', () => {
vout: 0,
amount: 400n,
runeTicker: 'TESTRUNE',
runeName: 'TESTRUNE',
runeId: { block: 888, tx: 8 },
scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'),
address: '3P4WqXDbSLRhzo2H6MT6YFbvBKBDPLbVtQ',
Expand All @@ -897,7 +886,6 @@ describe('edict', () => {
txid: 'txid',
vout: 1,
runeTicker: 'TESTRUNE',
runeName: 'TESTRUNE',
runeId: {
block: 888,
tx: 8,
Expand All @@ -908,7 +896,6 @@ describe('edict', () => {
txid: 'childtxid',
vout: 0,
runeTicker: 'TESTRUNE',
runeName: 'TESTRUNE',
runeId: {
block: 888,
tx: 8,
Expand Down Expand Up @@ -943,7 +930,6 @@ describe('edict', () => {
vout: 0,
amount: 400n,
runeTicker: 'TESTRUNE',
runeName: 'TESTRUNE',
runeId: { block: 888, tx: 8 },
scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'),
address: '3P4WqXDbSLRhzo2H6MT6YFbvBKBDPLbVtQ',
Expand Down Expand Up @@ -992,7 +978,6 @@ describe('edict', () => {
vout: 0,
amount: 400n,
runeTicker: 'TESTRUNE',
runeName: 'TESTRUNE',
runeId: { block: 888, tx: 8 },
scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'),
address: '3P4WqXDbSLRhzo2H6MT6YFbvBKBDPLbVtQ',
Expand All @@ -1015,7 +1000,6 @@ describe('edict', () => {
txid: 'txid',
vout: 1,
runeTicker: 'TESTRUNE',
runeName: 'TESTRUNE',
runeId: {
block: 888,
tx: 8,
Expand Down Expand Up @@ -1046,7 +1030,6 @@ describe('edict', () => {
vout: 0,
amount: 400n,
runeTicker: 'TESTRUNE',
runeName: 'TESTRUNE',
runeId: { block: 888, tx: 8 },
scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'),
address: '3P4WqXDbSLRhzo2H6MT6YFbvBKBDPLbVtQ',
Expand All @@ -1069,7 +1052,6 @@ describe('edict', () => {
txid: 'txid',
vout: 2,
runeTicker: 'TESTRUNE',
runeName: 'TESTRUNE',
runeId: {
block: 888,
tx: 8,
Expand Down Expand Up @@ -1104,7 +1086,6 @@ describe('edict', () => {
vout: 0,
amount: 400n,
runeTicker: 'TESTRUNE',
runeName: 'TESTRUNE',
runeId: { block: 888, tx: 8 },
scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'),
address: '3P4WqXDbSLRhzo2H6MT6YFbvBKBDPLbVtQ',
Expand All @@ -1128,7 +1109,6 @@ describe('edict', () => {
txid: 'txid',
vout: i + 1,
runeTicker: 'TESTRUNE',
runeName: 'TESTRUNE',
runeId: {
block: 888,
tx: 8,
Expand Down Expand Up @@ -1164,7 +1144,6 @@ describe('edict', () => {
vout: 0,
amount: 402n,
runeTicker: 'TESTRUNE',
runeName: 'TESTRUNE',
runeId: { block: 888, tx: 8 },
scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'),
address: '3P4WqXDbSLRhzo2H6MT6YFbvBKBDPLbVtQ',
Expand All @@ -1188,7 +1167,6 @@ describe('edict', () => {
txid: 'txid',
vout: i + 1,
runeTicker: 'TESTRUNE',
runeName: 'TESTRUNE',
runeId: {
block: 888,
tx: 8,
Expand Down Expand Up @@ -1227,7 +1205,6 @@ describe('edict', () => {
vout: 0,
amount: 500n,
runeTicker: 'TESTRUNE',
runeName: 'TESTRUNE',
runeId: { block: 888, tx: 8 },
scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'),
address: '3P4WqXDbSLRhzo2H6MT6YFbvBKBDPLbVtQ',
Expand All @@ -1251,7 +1228,6 @@ describe('edict', () => {
txid: 'txid',
vout: i + 1,
runeTicker: 'TESTRUNE',
runeName: 'TESTRUNE',
runeId: {
block: 888,
tx: 8,
Expand Down Expand Up @@ -1287,7 +1263,6 @@ describe('edict', () => {
vout: 0,
amount: 400n,
runeTicker: 'TESTRUNE',
runeName: 'TESTRUNE',
runeId: { block: 888, tx: 8 },
scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'),
address: '3P4WqXDbSLRhzo2H6MT6YFbvBKBDPLbVtQ',
Expand All @@ -1311,7 +1286,6 @@ describe('edict', () => {
txid: 'txid',
vout: i + 1,
runeTicker: 'TESTRUNE',
runeName: 'TESTRUNE',
runeId: {
block: 888,
tx: 8,
Expand Down Expand Up @@ -1347,7 +1321,6 @@ describe('edict', () => {
vout: 0,
amount: 400n,
runeTicker: 'TESTRUNE',
runeName: 'TESTRUNE',
runeId: { block: 888, tx: 8 },
scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'),
address: '3P4WqXDbSLRhzo2H6MT6YFbvBKBDPLbVtQ',
Expand All @@ -1371,7 +1344,6 @@ describe('edict', () => {
txid: 'txid',
vout: i + 1,
runeTicker: 'TESTRUNE',
runeName: 'TESTRUNE',
runeId: {
block: 888,
tx: 8,
Expand Down Expand Up @@ -1404,7 +1376,6 @@ describe('no runestone', () => {
vout: 0,
amount: 400n,
runeTicker: 'TESTRUNE',
runeName: 'TESTRUNE',
runeId: { block: 888, tx: 8 },
scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'),
address: '3P4WqXDbSLRhzo2H6MT6YFbvBKBDPLbVtQ',
Expand All @@ -1426,7 +1397,6 @@ describe('no runestone', () => {
txid: 'txid',
vout: 0,
runeTicker: 'TESTRUNE',
runeName: 'TESTRUNE',
runeId: {
block: 888,
tx: 8,
Expand Down Expand Up @@ -1456,7 +1426,6 @@ describe('no runestone', () => {
vout: 0,
amount: 400n,
runeTicker: 'TESTRUNE',
runeName: 'TESTRUNE',
runeId: { block: 888, tx: 8 },
scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'),
address: '3P4WqXDbSLRhzo2H6MT6YFbvBKBDPLbVtQ',
Expand All @@ -1478,7 +1447,6 @@ describe('no runestone', () => {
txid: 'txid',
vout: 1,
runeTicker: 'TESTRUNE',
runeName: 'TESTRUNE',
runeId: {
block: 888,
tx: 8,
Expand Down Expand Up @@ -1515,7 +1483,6 @@ describe('burning', () => {
vout: 0,
amount: 400n,
runeTicker: 'TESTRUNE',
runeName: 'TESTRUNE',
runeId: { block: 888, tx: 8 },
scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'),
address: '3P4WqXDbSLRhzo2H6MT6YFbvBKBDPLbVtQ',
Expand Down Expand Up @@ -1568,7 +1535,6 @@ describe('burning', () => {
vout: 0,
amount: 400n,
runeTicker: 'TESTRUNE',
runeName: 'TESTRUNE',
runeId: { block: 888, tx: 8 },
scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'),
address: '3P4WqXDbSLRhzo2H6MT6YFbvBKBDPLbVtQ',
Expand Down

0 comments on commit 669c472

Please sign in to comment.