Skip to content

Commit

Permalink
fix: Handle tick bitmap large number
Browse files Browse the repository at this point in the history
  • Loading branch information
jinoosss committed Dec 11, 2023
1 parent e262f61 commit 4dfc5f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/swap-router/src/swap-simulator/utility/tick.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export function nextInitializedTickWithinOneWord(
if (isTickToLeft) {
const { wordPos, bitPos } = tickBitmapPosition(compressed);
const mask = (1n << BigInt(bitPos)) - 1n + (1n << BigInt(bitPos));
const bitmap = BigInt(tickBitmaps[wordPos] || 0n);
const bitmap = BigInt(Number(tickBitmaps[wordPos]) || 0n);
const masked = bitmap & mask;

const initialized = masked !== 0n;
Expand All @@ -114,7 +114,7 @@ export function nextInitializedTickWithinOneWord(

const { wordPos, bitPos } = tickBitmapPosition(compressed + 1);
const mask = ~((1n << BigInt(bitPos)) - 1n);
const bitmap = BigInt(tickBitmaps[wordPos] || 0n);
const bitmap = BigInt(Number(tickBitmaps[wordPos]) || 0n);
const masked = bitmap & mask;

const initialized = masked !== 0n;
Expand Down

0 comments on commit 4dfc5f4

Please sign in to comment.