function testDrawVoting() public listMartenitsa {
console.log("[Before-Voting]");
console.log("Chasy's health token balance : ", healthToken.balanceOf(address(chasy)));
console.log("Jack's health token balance : ", healthToken.balanceOf(address(jack)));
vm.startPrank(jack);
martenitsaToken.createMartenitsa("balls");
marketplace.listMartenitsaForSale(1, 1 wei);
vm.stopPrank();
address alice = makeAddr("alice");
address charlie = makeAddr("charlie");
address david = makeAddr("david");
address john = makeAddr("john");
address sam = makeAddr("sam");
address patrick = makeAddr("patrick");
address jay = makeAddr("jay");
vm.prank(alice);
voting.voteForMartenitsa(0);
vm.prank(bob);
voting.voteForMartenitsa(0);
vm.prank(charlie);
voting.voteForMartenitsa(0);
vm.prank(david);
voting.voteForMartenitsa(0);
vm.prank(john);
voting.voteForMartenitsa(1);
vm.prank(sam);
voting.voteForMartenitsa(1);
vm.prank(patrick);
voting.voteForMartenitsa(1);
vm.prank(jay);
voting.voteForMartenitsa(1);
console.log("[Final Votes Results]");
console.log("Chasy's Martenitsa got ", voting.getVoteCount(0), "votes");
console.log("Jack's Martenistsa got ", voting.getVoteCount(1), "votes");
vm.warp(block.timestamp + 1 days + 1);
voting.announceWinner();
console.log("[After-Voting]");
console.log("Chasy's health token balance : %e", healthToken.balanceOf(address(chasy)));
console.log("Jack's health token balance : ", healthToken.balanceOf(address(jack)));
}
Ran 1 test for test/MartenitsaVoting.t.sol:MartenitsaVoting
[PASS] testDrawVoting() (gas: 1075090)
Logs:
[Before-Voting]
Chasy's health token balance : 0
Jack's health token balance : 0
[Final Votes Results]
Chasy's Martenitsa got 4 votes
Jack's Martenistsa got 4 votes
[After-Voting]
Chasy's health token balance : 1e18
Jack's health token balance : 0