@@ -12,62 +12,18 @@ import {AgoraGovernor} from "src/AgoraGovernor.sol";
12
12
import {AgoraGovernorMock} from "test/mocks/AgoraGovernorMock.sol " ;
13
13
14
14
import {MockToken} from "test/mocks/MockToken.sol " ;
15
+ import {Deployers} from "test/utils/Deployers.sol " ;
15
16
16
- contract AgoraGovernorTest is Test {
17
- // Contracts
18
- AgoraGovernorMock public governor;
19
- TimelockController public timelock;
20
- MockToken public token;
21
-
22
- // Addresses
23
- address deployer = makeAddr ("deployer " );
24
- address admin = makeAddr ("admin " );
25
- address proxyAdmin = makeAddr ("proxyAdmin " );
26
- address manager = makeAddr ("manager " );
27
- address minter = makeAddr ("minter " );
28
-
17
+ contract AgoraGovernorTest is Test , Deployers {
29
18
// Variables
30
- uint256 timelockDelay = 2 days ;
31
- uint48 votingDelay = 1 ;
32
- uint32 votingPeriod = 14 ;
33
- uint256 proposalThreshold = 1 ;
34
- uint256 quorumNumerator = 3000 ;
35
19
uint256 counter;
36
20
37
21
/*//////////////////////////////////////////////////////////////
38
22
SETUP
39
23
//////////////////////////////////////////////////////////////*/
40
24
41
25
function setUp () public virtual {
42
- vm.startPrank (deployer);
43
-
44
- // Deploy token
45
- token = new MockToken (minter);
46
-
47
- // Calculate governor address
48
- address governorAddress = vm.computeCreateAddress (deployer, vm.getNonce (deployer) + 1 );
49
-
50
- // Deploy timelock
51
- address [] memory proposers = new address [](1 );
52
- proposers[0 ] = governorAddress;
53
- address [] memory executors = new address [](1 );
54
- executors[0 ] = governorAddress;
55
- timelock = new TimelockController (timelockDelay, proposers, executors, deployer);
56
-
57
- // Deploy governor
58
- governor = new AgoraGovernorMock (
59
- votingDelay,
60
- votingPeriod,
61
- proposalThreshold,
62
- quorumNumerator,
63
- token,
64
- timelock,
65
- admin,
66
- manager,
67
- IHooks (address (0 ))
68
- );
69
-
70
- vm.stopPrank ();
26
+ deployGovernor (address (0 ));
71
27
}
72
28
73
29
function executeCallback () public payable virtual {
0 commit comments