File tree 2 files changed +11
-8
lines changed
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 {
139
139
const draw = Draw . load ( draws [ j ] . id ) ;
140
140
if ( ! draw ) continue ;
141
141
142
+ const juror = ensureUser ( draw . juror ) ;
143
+ juror . totalResolvedVotes = juror . totalResolvedVotes . plus ( ONE ) ;
144
+
142
145
// Since this is a ClassicVote entity, this will only work for the Classic DisputeKit (which has ID "1").
143
146
const vote = ClassicVote . load ( `${ round . disputeKit } -${ draw . id } ` ) ;
144
147
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
+ }
149
154
150
155
if ( vote . choice === null ) continue ;
151
156
@@ -155,9 +160,7 @@ export function handleNewPeriod(event: NewPeriod): void {
155
160
}
156
161
157
162
// 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 ) ;
161
164
162
165
juror . save ( ) ;
163
166
}
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @kleros/kleros-v2-subgraph" ,
3
- "version" : " 0.10.1 " ,
3
+ "version" : " 0.10.2 " ,
4
4
"license" : " MIT" ,
5
5
"scripts" : {
6
6
"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