@@ -35,6 +35,7 @@ contract KlerosCore_VotingTest is KlerosCore_TestBase {
35
35
sortitionModule.passPhase (); // Drawing phase
36
36
core.draw (disputeID, DEFAULT_NB_OF_JURORS);
37
37
38
+ uint256 NO = 0 ;
38
39
uint256 YES = 1 ;
39
40
uint256 salt = 123455678 ;
40
41
uint256 [] memory voteIDs = new uint256 [](1 );
@@ -79,6 +80,16 @@ contract KlerosCore_VotingTest is KlerosCore_TestBase {
79
80
(, bytes32 commitStored , , ) = disputeKit.getVoteInfo (0 , 0 , 0 );
80
81
assertEq (commitStored, keccak256 (abi.encodePacked (YES, salt)), "Incorrect commit " );
81
82
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
+
82
93
voteIDs = new uint256 [](2 ); // Create the leftover votes subset
83
94
voteIDs[0 ] = 1 ;
84
95
voteIDs[1 ] = 2 ;
0 commit comments