File tree Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -139,13 +139,18 @@ export function handleNewPeriod(event: NewPeriod): void {
139139 const draw = Draw . load ( draws [ j ] . id ) ;
140140 if ( ! draw ) continue ;
141141
142+ const juror = ensureUser ( draw . juror ) ;
143+ juror . totalResolvedVotes = juror . totalResolvedVotes . plus ( ONE ) ;
144+
142145 // Since this is a ClassicVote entity, this will only work for the Classic DisputeKit (which has ID "1").
143146 const vote = ClassicVote . load ( `${ round . disputeKit } -${ draw . id } ` ) ;
144147
145- if ( ! vote ) continue ;
146-
147- const juror = ensureUser ( draw . juror ) ;
148- juror . totalResolvedVotes = juror . totalResolvedVotes . plus ( ONE ) ;
148+ if ( ! vote ) {
149+ // Recalculate coherenceScore
150+ juror . coherenceScore = computeCoherenceScore ( juror . totalCoherentVotes , juror . totalResolvedVotes ) ;
151+ juror . save ( ) ;
152+ continue ;
153+ }
149154
150155 if ( vote . choice === null ) continue ;
151156
@@ -155,9 +160,7 @@ export function handleNewPeriod(event: NewPeriod): void {
155160 }
156161
157162 // Recalculate coherenceScore
158- if ( juror . totalResolvedVotes . gt ( ZERO ) ) {
159- juror . coherenceScore = computeCoherenceScore ( juror . totalCoherentVotes , juror . totalResolvedVotes ) ;
160- }
163+ juror . coherenceScore = computeCoherenceScore ( juror . totalCoherentVotes , juror . totalResolvedVotes ) ;
161164
162165 juror . save ( ) ;
163166 }
Original file line number Diff line number Diff line change 11{
22 "name" : " @kleros/kleros-v2-subgraph" ,
3- "version" : " 0.10.1 " ,
3+ "version" : " 0.10.2 " ,
44 "license" : " MIT" ,
55 "scripts" : {
66 "update:core:arbitrum-sepolia-devnet" : " ./scripts/update.sh arbitrumSepoliaDevnet arbitrum-sepolia core/subgraph.yaml" ,
You can’t perform that action at this time.
0 commit comments