Skip to content

Commit 6c40c01

Browse files
committed
chore: compilation fix
1 parent 9093a58 commit 6c40c01

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

contracts/src/arbitration/SortitionModule.sol

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
pragma solidity ^0.8.24;
44

55
import {KlerosCore} from "./KlerosCore.sol";
6+
import {CourtRegistry} from "./CourtRegistry.sol";
67
import {ISortitionModule} from "./interfaces/ISortitionModule.sol";
78
import {IDisputeKit} from "./interfaces/IDisputeKit.sol";
89
import {Initializable} from "../proxy/Initializable.sol";
@@ -402,14 +403,15 @@ contract SortitionModule is ISortitionModule, Initializable, UUPSProxiable {
402403
bytes32 stakePathID = SortitionTrees.toStakePathID(_account, _courtID);
403404
bool finished = false;
404405
uint96 currentCourtID = _courtID;
406+
CourtRegistry courts = core.courts();
405407
while (!finished) {
406408
// Tokens are also implicitly staked in parent courts through sortition module to increase the chance of being drawn.
407409
TreeKey key = CourtID.wrap(currentCourtID).toTreeKey();
408410
sortitionSumTrees[key].set(_newStake, stakePathID);
409411
if (currentCourtID == GENERAL_COURT) {
410412
finished = true;
411413
} else {
412-
(currentCourtID, , , , , ) = core.courts(currentCourtID); // Get the parent court.
414+
currentCourtID = courts.get(currentCourtID).parent; // Get the parent court.
413415
}
414416
}
415417
emit StakeSet(_account, _courtID, _newStake, juror.stakedPnk);

contracts/src/arbitration/dispute-kits/DisputeKitClassicBase.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ abstract contract DisputeKitClassicBase is IDisputeKit, Initializable, UUPSProxi
322322
Round storage round = dispute.rounds[localRoundID];
323323
{
324324
(uint96 courtID, , , , ) = core.disputes(_coreDisputeID);
325-
(, bool hiddenVotes, , , , ) = core.courts(courtID);
325+
bool hiddenVotes = core.courts().get(courtID).hiddenVotes;
326326
bytes32 actualVoteHash = hashVote(_choice, _salt, _justification);
327327

328328
// Save the votes.
@@ -587,7 +587,7 @@ abstract contract DisputeKitClassicBase is IDisputeKit, Initializable, UUPSProxi
587587
Round storage round = dispute.rounds[dispute.rounds.length - 1];
588588

589589
(uint96 courtID, , , , ) = core.disputes(_coreDisputeID);
590-
(, bool hiddenVotes, , , , ) = core.courts(courtID);
590+
bool hiddenVotes = core.courts().get(courtID).hiddenVotes;
591591
uint256 expectedTotalVoted = hiddenVotes ? round.totalCommitted : round.votes.length;
592592

593593
return round.totalVoted == expectedTotalVoted;

contracts/src/arbitration/university/SortitionModuleUniversity.sol

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
pragma solidity ^0.8.24;
44

55
import "./KlerosCoreUniversity.sol";
6+
import "../CourtRegistry.sol";
67
import "./ISortitionModuleUniversity.sol";
78
import "../interfaces/IDisputeKit.sol";
89
import "../../proxy/UUPSProxiable.sol";
@@ -258,14 +259,16 @@ contract SortitionModuleUniversity is ISortitionModuleUniversity, UUPSProxiable,
258259

259260
bool finished = false;
260261
uint96 currentCourtID = _courtID;
262+
// CourtRegistry courts = core.courts();
261263
while (!finished) {
262264
// Tokens are also implicitly staked in parent courts through sortition module to increase the chance of being drawn.
263265
juror.stakesByCourtID[currentCourtID] += _newStake;
264266
juror.stakesByCourtID[currentCourtID] -= currentStake;
265267
if (currentCourtID == GENERAL_COURT) {
266268
finished = true;
267269
} else {
268-
(currentCourtID, , , , , ) = core.courts(currentCourtID);
270+
(currentCourtID, , , , , , ) = core.courts(currentCourtID);
271+
// currentCourtID = courts.get(currentCourtID).parent;
269272
}
270273
}
271274
emit StakeSet(_account, _courtID, _newStake, juror.stakedPnk);

contracts/src/test/KlerosCoreMock.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import "../arbitration/KlerosCore.sol";
88
/// KlerosCore with view functions to use in Foundry tests.
99
contract KlerosCoreMock is KlerosCore {
1010
function getCourtChildren(uint256 _courtId) external view returns (uint256[] memory children) {
11-
children = courts[_courtId].children;
11+
children = courts.get(uint96(_courtId)).children;
1212
}
1313

1414
function extraDataToCourtIDMinJurorsDisputeKit(

0 commit comments

Comments
 (0)