File tree Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @magiceden-oss/runestone-lib" ,
3
- "version" : " 0.9.3 -alpha" ,
3
+ "version" : " 0.9.4 -alpha" ,
4
4
"description" : " " ,
5
5
"main" : " ./dist/index.js" ,
6
6
"types" : " ./dist/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -43,17 +43,18 @@ export interface RunestoneStorage {
43
43
saveBlockIndex ( runeBlockIndex : RuneBlockIndex ) : Promise < void > ;
44
44
45
45
/**
46
- * Get the etching that deployed the rune if it exists.
46
+ * Get the etching that deployed the rune if it exists (up to given blockheight) .
47
47
* @param runeLocation rune id string representation
48
+ * @param blockheight the block height
48
49
*/
49
- getEtching ( runeLocation : string ) : Promise < RuneEtching | null > ;
50
+ getEtching ( runeLocation : string , blockheight : number ) : Promise < RuneEtching | null > ;
50
51
51
52
/**
52
- * Get the total valid mint counts for rune.
53
+ * Get the total valid mint counts for rune up to and including specified block height .
53
54
* @param rune rune id string representation
54
- * @param blockhash hash to specify explicit block chain tip to use
55
+ * @param blockheight block height to count up to
55
56
*/
56
- getValidMintCount ( runeLocation : string , blockhash : string ) : Promise < number > ;
57
+ getValidMintCount ( runeLocation : string , blockheight : number ) : Promise < number > ;
57
58
58
59
getRuneLocation ( runeTicker : string ) : Promise < RuneLocation | null > ;
59
60
Original file line number Diff line number Diff line change @@ -280,7 +280,8 @@ export class RuneUpdater implements RuneBlockIndex {
280
280
for ( const balance of balances . values ( ) ) {
281
281
const runeIdString = RuneLocation . toString ( balance . runeId ) ;
282
282
const etching =
283
- etchingByRuneId . get ( runeIdString ) ?? ( await this . _storage . getEtching ( runeIdString ) ) ;
283
+ etchingByRuneId . get ( runeIdString ) ??
284
+ ( await this . _storage . getEtching ( runeIdString , this . block . height - 1 ) ) ;
284
285
if ( etching === null ) {
285
286
throw new Error ( 'Rune should exist at this point' ) ;
286
287
}
@@ -361,7 +362,8 @@ export class RuneUpdater implements RuneBlockIndex {
361
362
) ;
362
363
363
364
const etching =
364
- etchingByRuneId . get ( runeLocation ) ?? ( await this . _storage . getEtching ( runeLocation ) ) ;
365
+ etchingByRuneId . get ( runeLocation ) ??
366
+ ( await this . _storage . getEtching ( runeLocation , this . block . height - 1 ) ) ;
365
367
if ( etching === null || ! etching . valid || ! etching . terms ) {
366
368
return None ;
367
369
}
@@ -400,7 +402,7 @@ export class RuneUpdater implements RuneBlockIndex {
400
402
401
403
const totalMints =
402
404
currentBlockMints . count +
403
- ( await this . _storage . getValidMintCount ( runeLocation , this . block . previousblockhash ) ) ;
405
+ ( await this . _storage . getValidMintCount ( runeLocation , this . block . height - 1 ) ) ;
404
406
405
407
if ( totalMints >= cap ) {
406
408
return None ;
You can’t perform that action at this time.
0 commit comments