From 6f18ba6901f44112d035061e04ff39a803a0ad67 Mon Sep 17 00:00:00 2001 From: Juan Manuel Rodriguez Defago Date: Thu, 2 Mar 2023 11:43:09 -0300 Subject: [PATCH] fix: off-by-one error on new environments --- src/mappings/epochManager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mappings/epochManager.ts b/src/mappings/epochManager.ts index f6490005..8e2fd455 100644 --- a/src/mappings/epochManager.ts +++ b/src/mappings/epochManager.ts @@ -26,7 +26,7 @@ export function handleEpochLengthUpdate(event: EpochLengthUpdate): void { // Will only ever be 0 on initialization in the contracts graphNetwork.epochLength = event.params.epochLength.toI32() graphNetwork.lastLengthUpdateBlock = (addresses.isL1 ? event.block.number : graphNetwork.currentL1BlockNumber!).toI32() - graphNetwork.currentEpoch = 0 + graphNetwork.currentEpoch = event.params.epoch.toI32() graphNetwork.epochCount = 1 graphNetwork.lastLengthUpdateEpoch = graphNetwork.currentEpoch graphNetwork.save()