Skip to content

Commit dc14fe9

Browse files
committed
fix: populateCourts bigint comparison
1 parent 1165d3b commit dc14fe9

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

contracts/scripts/populateCourts.ts

+17-13
Original file line numberDiff line numberDiff line change
@@ -183,17 +183,17 @@ task("populate:courts", "Populates the courts and their parameters")
183183
);
184184
}
185185

186-
if (courtPresent.minStake !== court.minStake) {
186+
if (courtPresent.minStake !== toBigInt(court.minStake)) {
187187
change = true;
188188
console.log("Court %d: changing minStake from %d to %d", court.id, courtPresent.minStake, court.minStake);
189189
}
190190

191-
if (courtPresent.alpha !== court.alpha) {
191+
if (courtPresent.alpha !== toBigInt(court.alpha)) {
192192
change = true;
193193
console.log("Court %d: changing alpha from %d to %d", court.id, courtPresent.alpha, court.alpha);
194194
}
195195

196-
if (courtPresent.feeForJuror !== court.feeForJuror) {
196+
if (courtPresent.feeForJuror !== toBigInt(court.feeForJuror)) {
197197
change = true;
198198
console.log(
199199
"Court %d: changing feeForJuror from %d to %d",
@@ -203,7 +203,7 @@ task("populate:courts", "Populates the courts and their parameters")
203203
);
204204
}
205205

206-
if (courtPresent.jurorsForCourtJump !== court.jurorsForCourtJump) {
206+
if (courtPresent.jurorsForCourtJump !== toBigInt(court.jurorsForCourtJump)) {
207207
change = true;
208208
console.log(
209209
"Court %d: changing jurorsForCourtJump from %d to %d",
@@ -228,15 +228,19 @@ task("populate:courts", "Populates the courts and their parameters")
228228
console.log("Court %d: no parameter change", court.id);
229229
continue;
230230
}
231-
await core.changeCourtParameters(
232-
court.id,
233-
court.hiddenVotes,
234-
court.minStake,
235-
court.alpha,
236-
court.feeForJuror,
237-
court.jurorsForCourtJump,
238-
[court.timesPerPeriod[0], court.timesPerPeriod[1], court.timesPerPeriod[2], court.timesPerPeriod[3]]
239-
);
231+
try {
232+
await core.changeCourtParameters(
233+
court.id,
234+
court.hiddenVotes,
235+
court.minStake,
236+
court.alpha,
237+
court.feeForJuror,
238+
court.jurorsForCourtJump,
239+
[court.timesPerPeriod[0], court.timesPerPeriod[1], court.timesPerPeriod[2], court.timesPerPeriod[3]]
240+
);
241+
} catch (error) {
242+
console.error("Error changing court parameters: %s", error);
243+
}
240244
} else {
241245
console.log("Court %d not found, creating it with", court.id, court);
242246
if (coreType === Cores.UNIVERSITY) {

0 commit comments

Comments
 (0)