Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions contracts/src/arbitration/KlerosCore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -708,8 +708,10 @@ contract KlerosCore is IArbitratorV2, Initializable, UUPSProxiable {
if (round.drawnJurors.length != round.nbVotes) revert DisputeStillDrawing();
dispute.period = court.hiddenVotes ? Period.commit : Period.vote;
} else if (dispute.period == Period.commit) {
// Note that we do not want to pass to Voting period if all the commits are cast because it breaks the Shutter auto-reveal currently.
if (block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]) {
if (
block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&
!disputeKits[round.disputeKitID].areCommitsAllCast(_disputeID)
) {
revert CommitPeriodNotPassed();
}
dispute.period = Period.vote;
Expand Down
7 changes: 6 additions & 1 deletion contracts/test/foundry/KlerosCore_Voting.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ contract KlerosCore_VotingTest is KlerosCore_TestBase {
voteIDs[0] = 1;
voteIDs[1] = 2;

// Shouldn't allow to switch period yet.
vm.expectRevert(KlerosCore.CommitPeriodNotPassed.selector);
core.passPeriod(disputeID);

vm.prank(staker1);
vm.expectEmit(true, true, true, true);
emit DisputeKitClassicBase.CommitCast(disputeID, staker1, voteIDs, commit);
Expand All @@ -109,7 +113,8 @@ contract KlerosCore_VotingTest is KlerosCore_TestBase {
}

// Check reveal in the next period
vm.warp(block.timestamp + timesPerPeriod[1]);
// Should allow to switch period since all commits are cast.
//vm.warp(block.timestamp + timesPerPeriod[1]);
core.passPeriod(disputeID);

// Check the require with the wrong choice and then with the wrong salt
Expand Down
Loading