feat(Directory): add ownership capabilities to `Directory` (#90)
This commit is contained in:
parent
4f5651871b
commit
af449861d7
|
@ -1,7 +1,9 @@
|
|||
// SPDX-License-Identifier: UNLICENSED
|
||||
pragma solidity ^0.8.18;
|
||||
|
||||
contract Directory {
|
||||
import { Ownable2Step } from "@openzeppelin/contracts/access/Ownable2Step.sol";
|
||||
|
||||
contract Directory is Ownable2Step {
|
||||
address public votingContract;
|
||||
address public featuredVotingContract;
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -3,6 +3,7 @@ pragma solidity ^0.8.19;
|
|||
|
||||
import { Test } from "forge-std/Test.sol";
|
||||
import { DeployContracts } from "../script/DeployContracts.s.sol";
|
||||
import { DeploymentConfig } from "../script/DeploymentConfig.s.sol";
|
||||
import { Directory } from "../contracts/Directory.sol";
|
||||
import { VotingContract } from "../contracts/VotingContract.sol";
|
||||
import { FeaturedVotingContract } from "../contracts/FeaturedVotingContract.sol";
|
||||
|
@ -11,6 +12,7 @@ contract DirectoryTest is Test {
|
|||
Directory public directory;
|
||||
address internal votingContract;
|
||||
address internal featuredVotingContract;
|
||||
address internal deployer;
|
||||
|
||||
bytes internal communityID = "communityID";
|
||||
bytes internal communityID2 = "communityID2";
|
||||
|
@ -23,6 +25,9 @@ contract DirectoryTest is Test {
|
|||
directory = _directory;
|
||||
votingContract = address(_votingContract);
|
||||
featuredVotingContract = address(_featuredVotingContract);
|
||||
|
||||
DeploymentConfig deploymentConfig = deployment.getDeploymentConfig();
|
||||
deployer = deploymentConfig.deployer();
|
||||
}
|
||||
|
||||
function _addCommunitiesToDirectory(bytes[] memory communityIDs) internal {
|
||||
|
@ -35,6 +40,12 @@ contract DirectoryTest is Test {
|
|||
assert(directory.isCommunityInDirectory(communityIDs[i]));
|
||||
}
|
||||
}
|
||||
|
||||
function testDeployment() public {
|
||||
assertEq(directory.owner(), deployer);
|
||||
assertEq(directory.votingContract(), votingContract);
|
||||
assertEq(directory.featuredVotingContract(), featuredVotingContract);
|
||||
}
|
||||
}
|
||||
|
||||
contract IsCommunityInDirectoryTest is DirectoryTest {
|
||||
|
|
Loading…
Reference in New Issue