Skip to content

Commit

Permalink
Update in response to review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kronosapiens committed Oct 17, 2021
1 parent 0ec2a43 commit ec0f14a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
10 changes: 8 additions & 2 deletions contracts/colony/Colony.sol
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,12 @@ contract Colony is BasicMetaTransaction, ColonyStorage, PatriciaTreeProofs {
stoppable
authDomain(_permissionDomainId, _childSkillIndex, _domainId)
{
domains[_domainId].deprecated = _deprecated;
if (domains[_domainId].deprecated != _deprecated) {
domains[_domainId].deprecated = _deprecated;

emit DomainDeprecated(msg.sender, _domainId, _deprecated);
}

emit DomainDeprecated(msg.sender, _domainId, _deprecated);
}

function getDomain(uint256 _domainId) public view returns (Domain memory domain) {
Expand Down Expand Up @@ -387,6 +390,9 @@ contract Colony is BasicMetaTransaction, ColonyStorage, PatriciaTreeProofs {
sig = bytes4(keccak256("setDefaultGlobalClaimDelay(uint256)"));
colonyAuthority.setRoleCapability(uint8(ColonyRole.Root), address(this), sig, true);

sig = bytes4(keccak256("deprecateDomain(uint256,uint256,uint256,bool)"));
colonyAuthority.setRoleCapability(uint8(ColonyRole.Architecture), address(this), sig, true);

sig = bytes4(keccak256("setExpenditureMetadata(uint256,uint256,uint256,string)"));
colonyAuthority.setRoleCapability(uint8(ColonyRole.Arbitration), address(this), sig, true);
}
Expand Down
5 changes: 5 additions & 0 deletions test/contracts-network/colony.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,11 @@ contract("Colony", (accounts) => {
await expectEvent(colony.deprecateDomain(1, 0, 2, true), "DomainDeprecated", [USER0, 2, true]);
});

it("should not log the DomainDeprecated event if the state did not change", async () => {
await colony.addDomain(1, UINT256_MAX, 1);
await expectNoEvent(colony.deprecateDomain(1, 0, 2, false), "DomainDeprecated");
});

it("should not be able to perform prohibited actions in the domain", async () => {
await colony.addDomain(1, UINT256_MAX, 1);
await colony.deprecateDomain(1, 0, 2, true);
Expand Down

0 comments on commit ec0f14a

Please sign in to comment.