-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathBallotTest.t.sol
62 lines (42 loc) · 1.73 KB
/
BallotTest.t.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
import {Test, console2} from "forge-std/Test.sol";
import {VyperDeployer} from "snekmate-utils/VyperDeployer.sol";
import {ArgentineBallotDeployer} from "script/rotcivegaf-argentineballot/ArgentineBallotDeployer.s.sol";
import {IBallot} from "src/rotcivegaf-argentineballot/interfaces/IBallot.sol";
import {ILaw} from "src/rotcivegaf-argentineballot/interfaces/ILaw.sol";
/*///////////////////////////////////////////////
// Import dependencies for your solution here! //
// (if you need any) //
///////////////////////////////////////////////*/
contract BallotTest is Test, ArgentineBallotDeployer {
IBallot public ballot;
address player = address(420);
address president = address(240);
function setUp() public override(ArgentineBallotDeployer) {
ArgentineBallotDeployer.setUp();
vm.startPrank(president);
ILaw[] memory laws = new ILaw[](3);
laws[0] = ILaw(deployLaw());
laws[0].initialize();
laws[1] = ILaw(deployLaw());
laws[1].initialize();
laws[2] = ILaw(deployProposeLaw());
laws[2].initialize();
ballot = IBallot(deployArgentineBallot());
ballot.initialize(laws);
vm.stopPrank();
vm.deal(player, 1420);
vm.startPrank(player);
}
// @notice Test that the Ballot is unsolved if we don't do anything
function test_unsolved() external {
assertFalse(ballot.isSolved());
}
function test_solved() external {
/*//////////////////////////////////////
// Write your solution here //
//////////////////////////////////////*/
assertTrue(ballot.isSolved());
}
}