Skip to content

Commit

Permalink
fix: guarantee gap detection is comparing numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelcr committed Nov 4, 2023
1 parent b173a33 commit 0f3f51a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/pg/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function assertNoBlockInscriptionGap(args: {
currentBlockHeight: number;
newBlockHeight: number;
}) {
args.newNumbers.sort();
args.newNumbers.sort((a, b) => a - b);
for (let n = 0; n < args.newNumbers.length; n++) {
const curr = args.currentNumber + n;
const next = args.newNumbers[n];
Expand Down
3 changes: 2 additions & 1 deletion src/pg/pg-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ export class PgStore extends BasePgStore {
for (const operation of tx.metadata.ordinal_operations) {
if (operation.inscription_revealed) {
const reveal = operation.inscription_revealed;
if (reveal.inscription_number >= 0) newBlessedNumbers.push(reveal.inscription_number);
if (reveal.inscription_number >= 0)
newBlessedNumbers.push(parseInt(`${reveal.inscription_number}`));
const satoshi = new OrdinalSatoshi(reveal.ordinal_number);
const satpoint = parseSatPoint(reveal.satpoint_post_inscription);
const recursive_refs = getInscriptionRecursion(reveal.content_bytes);
Expand Down

0 comments on commit 0f3f51a

Please sign in to comment.