Skip to content

Commit 44ea55e

Browse files
committed
fix: correct round check
1 parent 05dcdb0 commit 44ea55e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

subgraph/core/src/DisputeKitClassic.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,17 +153,15 @@ export function handleChoiceFunded(event: ChoiceFunded): void {
153153
const numberOfRounds = klerosCore.getNumberOfRounds(BigInt.fromString(coreDisputeID));
154154
const roundInfo = klerosCore.getRoundInfo(BigInt.fromString(coreDisputeID), numberOfRounds.minus(ONE));
155155
const appealCost = roundInfo.totalFeesForJurors;
156-
const currentDisputeKitID = roundInfo.disputeKitID;
157156

158157
localRound.feeRewards = localRound.feeRewards.minus(appealCost);
159158

160-
const newRoundInfo = klerosCore.getRoundInfo(BigInt.fromString(coreDisputeID), numberOfRounds);
161-
const newDisputeKitID = newRoundInfo.disputeKitID;
159+
const newDisputeKitID = roundInfo.disputeKitID;
162160

163161
const localDispute = ClassicDispute.load(`${disputeKitID}-${coreDisputeID}`);
164162
if (!localDispute) return;
165163

166-
if (currentDisputeKitID === newDisputeKitID) {
164+
if (BigInt.fromString(disputeKitID) === newDisputeKitID) {
167165
const newRoundIndex = localDispute.currentLocalRoundIndex.plus(ONE);
168166
const numberOfChoices = localDispute.numberOfChoices;
169167
localDispute.currentLocalRoundIndex = newRoundIndex;

0 commit comments

Comments
 (0)