diff --git a/contracts/src/arbitration/KlerosCore.sol b/contracts/src/arbitration/KlerosCore.sol index 447579812..a3ecac170 100644 --- a/contracts/src/arbitration/KlerosCore.sol +++ b/contracts/src/arbitration/KlerosCore.sol @@ -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; diff --git a/contracts/test/foundry/KlerosCore_Voting.t.sol b/contracts/test/foundry/KlerosCore_Voting.t.sol index 398ff4b95..61fd92c1a 100644 --- a/contracts/test/foundry/KlerosCore_Voting.t.sol +++ b/contracts/test/foundry/KlerosCore_Voting.t.sol @@ -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); @@ -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