Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alvrs committed Apr 29, 2024
1 parent e1eee34 commit 6ad0bbe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/store-indexer/bin/postgres-indexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ async function getDistanceFromFollowBlock(): Promise<bigint> {
getLatestStoredBlockNumber(),
publicClient.getBlock({ blockTag: env.FOLLOW_BLOCK_TAG }),
]);
return (latestFollowBlockNumber ?? -1n) - latestStoredBlock.number;
return (latestStoredBlockNumber ?? -1n) - latestFollowBlock.number;
}

const latestStoredBlockNumber = await getLatestStoredBlockNumber();
Expand Down
8 changes: 4 additions & 4 deletions packages/store-indexer/bin/sqlite-indexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ async function getLatestStoredBlockNumber(): Promise<bigint | undefined> {
}

async function getDistanceFromFollowBlock(): Promise<bigint> {
const [latestStoredBlockNumber, latestFollowBlockNumber] = await Promise.all([
(await getLatestStoredBlockNumber()) ?? -1n,
(await publicClient.getBlock({ blockTag: env.FOLLOW_BLOCK_TAG })).number,
const [latestStoredBlockNumber, latestFollowBlock] = await Promise.all([
getLatestStoredBlockNumber(),
publicClient.getBlock({ blockTag: env.FOLLOW_BLOCK_TAG }),
]);
return latestFollowBlockNumber - latestStoredBlockNumber;
return (latestStoredBlockNumber ?? -1n) - latestFollowBlock.number;
}

const currentChainState = await getCurrentChainState();
Expand Down

0 comments on commit 6ad0bbe

Please sign in to comment.