Skip to content

Commit

Permalink
Remove unneeded getter functions
Browse files Browse the repository at this point in the history
  • Loading branch information
mds1 committed Aug 4, 2020
1 parent 5d3bdc9 commit 746367b
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 28 deletions.
2 changes: 1 addition & 1 deletion contracts/Fund.sol
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ contract Fund is Administratable {
{
OrgFactory orgFactory = OrgFactory(orgFactoryContractAddress);

return orgFactory.getAllowedOrg(recipient);
return orgFactory.allowedOrgs(recipient);
}

/**
Expand Down
8 changes: 0 additions & 8 deletions contracts/FundFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,4 @@ contract FundFactory is Administratable {
function countFunds() external view returns (uint256) {
return createdFunds.length;
}

/**
* @notice Returns address of a specific fund in createdFunds[]
* @param index The index position of the Fund
*/
function getFund(uint256 index) external view returns (address) {
return address(createdFunds[index]);
}
}
16 changes: 0 additions & 16 deletions contracts/OrgFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,4 @@ contract OrgFactory is Administratable {
function countDeployedOrgs() external view returns (uint256) {
return deployedOrgs.length;
}

/**
* @notice Returns address of given index postiion in deployedOrgs[].
* @param index Array position of requested org
*/
function getDeployedOrg(uint256 index) external view returns (address) {
return address(deployedOrgs[index]);
}

/**
* @notice Returns boolean if provided address is present in allowedOrgs[].
* @param org address of the organization contract requested.
*/
function getAllowedOrg(address org) external view returns (bool) {
return allowedOrgs[org];
}
}
4 changes: 2 additions & 2 deletions test/OrgFactory.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ describe("OrgFactory", function () {
{ from: accountant }
);

const getFundAddress = await this.orgFactory.getDeployedOrg(0);
const getFundAddress = await this.orgFactory.deployedOrgs(0);

assert.equal(org.logs[0].args.newAddress, getFundAddress);
});
Expand All @@ -112,7 +112,7 @@ describe("OrgFactory", function () {
{ from: accountant }
);

const getOrgExistence = await this.orgFactory.getDeployedOrg(
const getOrgExistence = await this.orgFactory.deployedOrgs(
0, { from: admin }
);

Expand Down
2 changes: 1 addition & 1 deletion test/fundFactory.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ describe("FundFactory", function () {
{ from: accountant }
);

const getFundAddress = await this.fundFactory.getFund(0);
const getFundAddress = await this.fundFactory.createdFunds(0);

assert.equal(fund.logs[0].args.newAddress, getFundAddress);
});
Expand Down

0 comments on commit 746367b

Please sign in to comment.