Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ abstract contract DisputeKitClassicBase is IDisputeKit, Initializable, UUPSProxi
Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];
Round storage round = dispute.rounds[dispute.rounds.length - 1];
for (uint256 i = 0; i < _voteIDs.length; i++) {
if (round.votes[_voteIDs[i]].commit != bytes32(0)) revert AlreadyCommittedThisVote();
if (round.votes[_voteIDs[i]].account != msg.sender) revert JurorHasToOwnTheVote();
round.votes[_voteIDs[i]].commit = _commit;
}
Expand Down Expand Up @@ -759,4 +760,5 @@ abstract contract DisputeKitClassicBase is IDisputeKit, Initializable, UUPSProxi
error AppealFeeIsAlreadyPaid();
error DisputeNotResolved();
error CoreIsPaused();
error AlreadyCommittedThisVote();
}
4 changes: 4 additions & 0 deletions contracts/test/foundry/KlerosCore_Voting.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ contract KlerosCore_VotingTest is KlerosCore_TestBase {
assertEq(commitStored, keccak256(abi.encodePacked(YES, salt)), "Incorrect commit");
}

vm.prank(staker1);
vm.expectRevert(DisputeKitClassicBase.AlreadyCommittedThisVote.selector);
disputeKit.castCommit(disputeID, voteIDs, commit);

// Check reveal in the next period
vm.warp(block.timestamp + timesPerPeriod[1]);
core.passPeriod(disputeID);
Expand Down
Loading