@@ -273,20 +273,21 @@ export class RuneUpdater implements RuneBlockIndex {
273273 continue ;
274274 }
275275
276- const runeByRuneId = new Map (
277- this . etchings . map ( ( etching ) => [ RuneLocation . toString ( etching . runeId ) , etching . rune ] )
276+ const runeNameByRuneId = new Map (
277+ this . etchings . map ( ( etching ) => [ RuneLocation . toString ( etching . runeId ) , etching . runeName ] )
278278 ) ;
279279 for ( const balance of balances . values ( ) ) {
280280 const runeIdString = RuneLocation . toString ( balance . runeId ) ;
281- const rune =
282- runeByRuneId . get ( runeIdString ) ?? ( await this . _storage . getEtching ( runeIdString ) ) ?. rune ;
283- if ( rune === undefined ) {
281+ const runeName =
282+ runeNameByRuneId . get ( runeIdString ) ??
283+ ( await this . _storage . getEtching ( runeIdString ) ) ?. runeName ;
284+ if ( runeName === undefined ) {
284285 throw new Error ( 'Rune should exist at this point' ) ;
285286 }
286287
287288 this . utxoBalances . push ( {
288289 runeId : balance . runeId ,
289- rune ,
290+ runeName ,
290291 amount : balance . amount ,
291292 scriptPubKey : Buffer . from ( output . scriptPubKey . hex ) ,
292293 txid : tx . txid ,
@@ -331,7 +332,9 @@ export class RuneUpdater implements RuneBlockIndex {
331332 if (
332333 rune . value < this . _minimum . value ||
333334 rune . reserved ||
334- this . etchings . find ( ( etching ) => etching . rune === rune . toString ( ) ) ||
335+ this . etchings . find (
336+ ( etching ) => SpacedRune . fromString ( etching . runeName ) . rune . toString ( ) === rune . toString ( )
337+ ) ||
335338 ( await this . _storage . getRuneLocation ( rune . toString ( ) ) ) !== null ||
336339 ! ( await this . txCommitsToRune ( tx , rune ) )
337340 ) {
@@ -509,7 +512,7 @@ export class RuneUpdater implements RuneBlockIndex {
509512 const { divisibility, terms, premine, spacers, symbol } = artifact . etching . unwrap ( ) ;
510513 this . etchings . push ( {
511514 valid : true ,
512- rune : new SpacedRune ( rune , Number ( spacers . map ( Number ) . unwrapOr ( 0 ) ) ) . toString ( ) ,
515+ runeName : new SpacedRune ( rune , Number ( spacers . map ( Number ) . unwrapOr ( 0 ) ) ) . toString ( ) ,
513516 runeId,
514517 txid,
515518 ...( divisibility . isSome ( ) ? { divisibility : divisibility . map ( Number ) . unwrap ( ) } : { } ) ,
@@ -560,7 +563,7 @@ export class RuneUpdater implements RuneBlockIndex {
560563 valid : false ,
561564 runeId,
562565 txid,
563- rune : rune . toString ( ) ,
566+ runeName : rune . toString ( ) ,
564567 } ) ;
565568 }
566569 }
0 commit comments