Skip to content

Commit

Permalink
fix(store-sync): recs progress percentage should be out of 100 (latti…
Browse files Browse the repository at this point in the history
  • Loading branch information
holic authored Oct 13, 2023
1 parent 4e2a170 commit d1549ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/store-sync/src/createStoreSync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export async function createStoreSync<TConfig extends StoreConfig = StoreConfig>
await storageAdapter({ blockNumber, logs: chunk });
onProgress?.({
step: SyncStep.SNAPSHOT,
percentage: (i + chunk.length) / chunks.length,
percentage: ((i + chunk.length) / chunks.length) * 100,
latestBlockNumber: 0n,
lastBlockNumberProcessed: blockNumber,
message: "Hydrating from snapshot",
Expand Down Expand Up @@ -222,7 +222,7 @@ export async function createStoreSync<TConfig extends StoreConfig = StoreConfig>
const processedBlocks = lastBlockNumberProcessed - startBlock;
onProgress?.({
step: SyncStep.RPC,
percentage: Number((processedBlocks * 1000n) / totalBlocks) / 1000,
percentage: Number((processedBlocks * 1000n) / totalBlocks) / 10,
latestBlockNumber: endBlock,
lastBlockNumberProcessed,
message: "Hydrating from RPC",
Expand Down

0 comments on commit d1549ea

Please sign in to comment.