@@ -237,33 +237,37 @@ task("populate:courts", "Populates the courts and their parameters")
237
237
}
238
238
} else {
239
239
console . log ( "Court %d not found, creating it with" , court . id , court ) ;
240
- if ( coreType === Cores . UNIVERSITY ) {
241
- await ( core as KlerosCoreUniversity ) . createCourt
242
- . populateTransaction (
243
- court . parent ,
244
- court . hiddenVotes ,
245
- court . minStake ,
246
- court . alpha ,
247
- court . feeForJuror ,
248
- court . jurorsForCourtJump ,
249
- [ court . timesPerPeriod [ 0 ] , court . timesPerPeriod [ 1 ] , court . timesPerPeriod [ 2 ] , court . timesPerPeriod [ 3 ] ] ,
250
- [ DISPUTE_KIT_CLASSIC ]
251
- )
252
- . then ( execute ) ;
253
- } else {
254
- await ( core as KlerosCore ) . createCourt
255
- . populateTransaction (
256
- court . parent ,
257
- court . hiddenVotes ,
258
- court . minStake ,
259
- court . alpha ,
260
- court . feeForJuror ,
261
- court . jurorsForCourtJump ,
262
- [ court . timesPerPeriod [ 0 ] , court . timesPerPeriod [ 1 ] , court . timesPerPeriod [ 2 ] , court . timesPerPeriod [ 3 ] ] ,
263
- ethers . toBeHex ( 5 ) , // Not accessible on-chain, but has always been set to the same value so far.
264
- [ DISPUTE_KIT_CLASSIC ]
265
- )
266
- . then ( execute ) ;
240
+ try {
241
+ if ( coreType === Cores . UNIVERSITY ) {
242
+ await ( core as KlerosCoreUniversity ) . createCourt
243
+ . populateTransaction (
244
+ court . parent ,
245
+ court . hiddenVotes ,
246
+ court . minStake ,
247
+ court . alpha ,
248
+ court . feeForJuror ,
249
+ court . jurorsForCourtJump ,
250
+ [ court . timesPerPeriod [ 0 ] , court . timesPerPeriod [ 1 ] , court . timesPerPeriod [ 2 ] , court . timesPerPeriod [ 3 ] ] ,
251
+ [ DISPUTE_KIT_CLASSIC ]
252
+ )
253
+ . then ( execute ) ;
254
+ } else {
255
+ await ( core as KlerosCore ) . createCourt
256
+ . populateTransaction (
257
+ court . parent ,
258
+ court . hiddenVotes ,
259
+ court . minStake ,
260
+ court . alpha ,
261
+ court . feeForJuror ,
262
+ court . jurorsForCourtJump ,
263
+ [ court . timesPerPeriod [ 0 ] , court . timesPerPeriod [ 1 ] , court . timesPerPeriod [ 2 ] , court . timesPerPeriod [ 3 ] ] ,
264
+ ethers . toBeHex ( 5 ) , // Not accessible on-chain, but has always been set to the same value so far.
265
+ [ DISPUTE_KIT_CLASSIC ]
266
+ )
267
+ . then ( execute ) ;
268
+ }
269
+ } catch ( error ) {
270
+ console . error ( `Failed to create court ${ court . id } : ${ error } ` ) ;
267
271
}
268
272
}
269
273
0 commit comments