@@ -35,6 +35,7 @@ contract KlerosCore_VotingTest is KlerosCore_TestBase {
3535 sortitionModule.passPhase (); // Drawing phase
3636 core.draw (disputeID, DEFAULT_NB_OF_JURORS);
3737
38+ uint256 NO = 0 ;
3839 uint256 YES = 1 ;
3940 uint256 salt = 123455678 ;
4041 uint256 [] memory voteIDs = new uint256 [](1 );
@@ -79,6 +80,16 @@ contract KlerosCore_VotingTest is KlerosCore_TestBase {
7980 (, bytes32 commitStored , , ) = disputeKit.getVoteInfo (0 , 0 , 0 );
8081 assertEq (commitStored, keccak256 (abi.encodePacked (YES, salt)), "Incorrect commit " );
8182
83+ // Cast again with the same voteID to check that the count doesn't increase.
84+ bytes32 newCommit = keccak256 (abi.encodePacked (NO, salt));
85+ vm.prank (staker1);
86+ disputeKit.castCommit (disputeID, voteIDs, newCommit);
87+
88+ (, , , totalCommited, , ) = disputeKit.getRoundInfo (disputeID, 0 , 0 );
89+ assertEq (totalCommited, 1 , "totalCommited should still be 1 " );
90+ (, commitStored, , ) = disputeKit.getVoteInfo (0 , 0 , 0 );
91+ assertEq (commitStored, keccak256 (abi.encodePacked (NO, salt)), "Incorrect commit after recommitting " );
92+
8293 voteIDs = new uint256 [](2 ); // Create the leftover votes subset
8394 voteIDs[0 ] = 1 ;
8495 voteIDs[1 ] = 2 ;
0 commit comments