@@ -25,7 +25,7 @@ import { updateJurorDelayedStake, updateJurorStake } from "./entities/JurorToken
2525import { createDrawFromEvent } from "./entities/Draw" ;
2626import { updateTokenAndEthShiftFromEvent } from "./entities/TokenAndEthShift" ;
2727import { updateArbitrableCases } from "./entities/Arbitrable" ;
28- import { Court , Dispute , FeeToken } from "../generated/schema" ;
28+ import { Court , Dispute , FeeToken , User } from "../generated/schema" ;
2929import { BigInt } from "@graphprotocol/graph-ts" ;
3030import { updatePenalty } from "./entities/Penalty" ;
3131import { ensureFeeToken } from "./entities/FeeToken" ;
@@ -94,6 +94,12 @@ export function handleNewPeriod(event: NewPeriod): void {
9494 court . numberVotingDisputes = court . numberVotingDisputes . minus ( ONE ) ;
9595 updateCasesVoting ( BigInt . fromI32 ( - 1 ) , event . block . timestamp ) ;
9696 } else if ( dispute . period === "appeal" ) {
97+ let juror : User ;
98+ for ( let i = 0 ; i < dispute . jurors . entries . length ; i ++ ) {
99+ juror = ensureUser ( dispute . jurors . entries [ 0 ] . value . toString ( ) ) ;
100+ juror . totalAppealingDisputes = juror . totalAppealingDisputes . minus ( ONE ) ;
101+ juror . save ( ) ;
102+ }
97103 court . numberAppealingDisputes = court . numberAppealingDisputes . minus ( ONE ) ;
98104 updateCasesAppealing ( BigInt . fromI32 ( - 1 ) , event . block . timestamp ) ;
99105 }
@@ -103,6 +109,12 @@ export function handleNewPeriod(event: NewPeriod): void {
103109 court . numberVotingDisputes = court . numberVotingDisputes . plus ( ONE ) ;
104110 updateCasesVoting ( ONE , event . block . timestamp ) ;
105111 } else if ( newPeriod === "appeal" ) {
112+ let juror : User ;
113+ for ( let i = 0 ; i < dispute . jurors . entries . length ; i ++ ) {
114+ juror = ensureUser ( dispute . jurors . entries [ 0 ] . value . toString ( ) ) ;
115+ juror . totalAppealingDisputes = juror . totalAppealingDisputes . plus ( ONE ) ;
116+ juror . save ( ) ;
117+ }
106118 court . numberAppealingDisputes = court . numberAppealingDisputes . plus ( ONE ) ;
107119 updateCasesAppealing ( ONE , event . block . timestamp ) ;
108120 } else if ( newPeriod === "execution" ) {
0 commit comments