diff --git a/subgraph/core/src/KlerosCore.ts b/subgraph/core/src/KlerosCore.ts index 42a54644f..519ee51c4 100644 --- a/subgraph/core/src/KlerosCore.ts +++ b/subgraph/core/src/KlerosCore.ts @@ -215,10 +215,19 @@ export function handleAppealDecision(event: AppealDecision): void { const disputeID = event.params._disputeID; const dispute = Dispute.load(disputeID.toString()); if (!dispute) return; + + // Load the current (previous) round + const previousRoundID = dispute.currentRound; + const previousRound = Round.load(previousRoundID); + if (previousRound) { + previousRound.isCurrentRound = false; + previousRound.save(); + } + const newRoundIndex = dispute.currentRoundIndex.plus(ONE); - const roundID = `${disputeID}-${newRoundIndex.toString()}`; + const newRoundID = `${disputeID}-${newRoundIndex.toString()}`; dispute.currentRoundIndex = newRoundIndex; - dispute.currentRound = roundID; + dispute.currentRound = newRoundID; dispute.save(); const roundInfo = contract.getRoundInfo(disputeID, newRoundIndex); diff --git a/subgraph/package.json b/subgraph/package.json index e63da74b7..05ab7235a 100644 --- a/subgraph/package.json +++ b/subgraph/package.json @@ -1,6 +1,6 @@ { "name": "@kleros/kleros-v2-subgraph", - "version": "0.15.3", + "version": "0.15.4", "drtVersion": "0.12.0", "license": "MIT", "scripts": {