of the competition by calling the `cancelParticipation()` function, upon existing
the competition, his token was burn and his token was burned and his stakedAsset
transferred to his address. The issue here is that his stakedAsset wasn't deducted
from the `totalParticipantShares` which is a big issue here and `totalParticipantShares`
wasn't updated.
*/
function test_cancelDoesNotUpdateTotalParticipantShares() public {
uint256 totalSharesBeforeEntry = briVault.totalParticipantShares();
vm.startPrank(user1);
mockToken.approve(address(briVault), 5 ether);
uint256 user1shares = briVault.deposit(5 ether, user1);
briVault.joinEvent(10);
console.log("user1 shares", user1shares);
vm.stopPrank();
vm.startPrank(user2);
mockToken.approve(address(briVault), 5 ether);
uint256 user2shares = briVault.deposit(5 ether, user2);
briVault.joinEvent(20);
console.log("user2 shares", user2shares);
vm.stopPrank();
vm.startPrank(user3);
mockToken.approve(address(briVault), 5 ether);
uint256 user3shares = briVault.deposit(5 ether, user3);
briVault.joinEvent(30);
console.log("user3 shares", user3shares);
vm.stopPrank();
vm.startPrank(user4);
mockToken.approve(address(briVault), 5 ether);
uint256 user4shares = briVault.deposit(5 ether, user4);
briVault.joinEvent(40);
console.log("user4 shares", user4shares);
vm.stopPrank();
uint256 totalSharesBeforeAnyUserCancelParticipation = briVault.totalParticipantShares();
vm.startPrank(user1);
briVault.cancelParticipation();
vm.stopPrank();
uint256 totalSharesAfterUser1CancelParticipation = briVault.totalParticipantShares();
console.log("Total Shares Before Entry:", totalSharesBeforeEntry);
console.log("Total Shares Before Any User Cancel Participation:", totalSharesBeforeAnyUserCancelParticipation);
console.log("Total Shares After User1 Cancel Participation:", totalSharesAfterUser1CancelParticipation);
assertEq(totalSharesBeforeAnyUserCancelParticipation, totalSharesAfterUser1CancelParticipation);
}