permissions : reverted the require check in getIndex functions

This commit is contained in:
vsmk98 2019-08-01 10:29:52 +08:00
parent 21780cf12f
commit bce6c1566d
5 changed files with 0 additions and 6 deletions

View File

@ -303,7 +303,6 @@ contract AccountManager {
* @return account index
*/
function _getAccountIndex(address _account) internal view returns (uint256) {
require(accountIndex[_account] > 0, "account not in the map");
return accountIndex[_account] - 1;
}

View File

@ -206,7 +206,6 @@ contract NodeManager {
*/
function _getNodeIndex(string memory _enodeId) internal view
returns (uint256) {
require(nodeIdToIndex[keccak256(abi.encode(_enodeId))] > 0, "node not in the map");
return nodeIdToIndex[keccak256(abi.encode(_enodeId))] - 1;
}

View File

@ -335,7 +335,6 @@ contract OrgManager {
* @return org index
*/
function _getOrgIndex(string memory _orgId) public view returns (uint){
require(OrgIndex[keccak256(abi.encodePacked(_orgId))] > 0, "org not in the map");
return OrgIndex[keccak256(abi.encodePacked(_orgId))] - 1;
}

View File

@ -192,7 +192,6 @@ contract RoleManager {
*/
function _getRoleIndex(string memory _roleId, string memory _orgId)
internal view returns (uint256) {
require(roleIndex[keccak256(abi.encode(_roleId, _orgId))] > 0, "role not in the map");
return roleIndex[keccak256(abi.encode(_roleId, _orgId))] - 1;
}
}

View File

@ -235,7 +235,6 @@ contract VoterManager {
function _getVoterIndex(string memory _orgId, address _vAccount)
internal view returns (uint256) {
uint256 orgIndex = _getVoterOrgIndex(_orgId);
require(orgVoterList[orgIndex].voterIndex[_vAccount] > 0, "record not in the map");
return orgVoterList[orgIndex].voterIndex[_vAccount] - 1;
}
@ -243,7 +242,6 @@ contract VoterManager {
*/
function _getVoterOrgIndex(string memory _orgId)
internal view returns (uint256) {
require(VoterOrgIndex[keccak256(abi.encode(_orgId))] > 0, "record not in the map");
return VoterOrgIndex[keccak256(abi.encode(_orgId))] - 1;
}