Skip to content

Commit 30382a0

Browse files
authored
Merge pull request #2007 from kleros/fix/update-iscurrentround
Fix: Update isCurrentRound for previous round on appeal
2 parents 282b91d + 367549c commit 30382a0

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

subgraph/core/src/KlerosCore.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,19 @@ export function handleAppealDecision(event: AppealDecision): void {
215215
const disputeID = event.params._disputeID;
216216
const dispute = Dispute.load(disputeID.toString());
217217
if (!dispute) return;
218+
219+
// Load the current (previous) round
220+
const previousRoundID = dispute.currentRound;
221+
const previousRound = Round.load(previousRoundID);
222+
if (previousRound) {
223+
previousRound.isCurrentRound = false;
224+
previousRound.save();
225+
}
226+
218227
const newRoundIndex = dispute.currentRoundIndex.plus(ONE);
219-
const roundID = `${disputeID}-${newRoundIndex.toString()}`;
228+
const newRoundID = `${disputeID}-${newRoundIndex.toString()}`;
220229
dispute.currentRoundIndex = newRoundIndex;
221-
dispute.currentRound = roundID;
230+
dispute.currentRound = newRoundID;
222231
dispute.save();
223232
const roundInfo = contract.getRoundInfo(disputeID, newRoundIndex);
224233

subgraph/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kleros/kleros-v2-subgraph",
3-
"version": "0.15.3",
3+
"version": "0.15.4",
44
"drtVersion": "0.12.0",
55
"license": "MIT",
66
"scripts": {

0 commit comments

Comments
 (0)