diff --git a/app/dataSources/SubgraphSource.ts b/app/dataSources/SubgraphSource.ts index d8b5fe9..6a0af2f 100644 --- a/app/dataSources/SubgraphSource.ts +++ b/app/dataSources/SubgraphSource.ts @@ -122,13 +122,13 @@ export class SubgraphSource extends AbstractSource { async getBlocksDelay(): Promise<{ diff: bigint; nodeBlockNumber: bigint; sourceBlockNumber: bigint }> { const [latestBock, { _meta }] = await Promise.all([ - this.network.getLatestBlockNumber(), + this.network.queryLatestBlock().then(b => BigInt(b.number.toString())), this.query(this.subgraphUrl, QUERY_META), ]); return { - diff: BigInt(latestBock) - BigInt(_meta.block.number), - nodeBlockNumber: BigInt(latestBock), - sourceBlockNumber: BigInt(latestBock), + diff: latestBock - BigInt(_meta.block.number), + nodeBlockNumber: latestBock, + sourceBlockNumber: latestBock, }; } diff --git a/app/dataSources/SubquerySource.ts b/app/dataSources/SubquerySource.ts index 8d15e48..2f98314 100644 --- a/app/dataSources/SubquerySource.ts +++ b/app/dataSources/SubquerySource.ts @@ -57,13 +57,13 @@ export class SubquerySource extends SubgraphSource { async getBlocksDelay(): Promise<{ diff: bigint; nodeBlockNumber: bigint; sourceBlockNumber: bigint }> { const [latestBock, { _metadata }] = await Promise.all([ - this.network.getLatestBlockNumber(), + this.network.queryLatestBlock().then(b => BigInt(b.number.toString())), this.query(this.subgraphUrl, QUERY_META), ]); return { - diff: BigInt(latestBock) - BigInt(_metadata.lastProcessedHeight), - nodeBlockNumber: BigInt(latestBock), - sourceBlockNumber: BigInt(latestBock), + diff: latestBock - BigInt(_metadata.lastProcessedHeight), + nodeBlockNumber: latestBock, + sourceBlockNumber: latestBock, }; }