Skip to content

Commit

Permalink
chore(Profile): rename internal check methods
Browse files Browse the repository at this point in the history
  • Loading branch information
nxqbao committed Nov 27, 2023
1 parent b70b604 commit 7e6391e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion contracts/multi-chains/RoninTrustedOrganization.sol
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ contract RoninTrustedOrganization is IRoninTrustedOrganization, HasProxyAdmin, H
/**
* @inheritdoc IRoninTrustedOrganization
*/
function getTrustedOrganization(TConsensus _consensusAddr) external view returns (TrustedOrganization memory) {
function getTrustedOrganization(TConsensus _consensusAddr) external view returns (TrustedOrganization memory trustedOrg) {
for (uint i = 0; i < _consensusList.length; ++i) {
if (_consensusList[i] == _consensusAddr) {
return getTrustedOrganizationAt(i);
Expand Down
8 changes: 4 additions & 4 deletions contracts/ronin/profile/ProfileHandler.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ abstract contract ProfileHandler is ProfileStorage {
}

function _requireNonDuplicated(RoleAccess addressType, address addr) internal view {
if (_checkNonDuplicatedAddr(addr)) {
if (_isRegisteredAddr(addr)) {
revert ErrDuplicatedInfo(addressType, uint256(uint160(addr)));
}
}

function _checkNonDuplicatedAddr(address addr) internal view returns (bool) {
function _isRegisteredAddr(address addr) internal view returns (bool) {
return _registry[uint256(uint160(addr))];
}

function _requireNonDuplicatedPubkey(bytes memory pubkey) internal view {
if (_checkNonDuplicatedPubkey(pubkey)) {
if (_isRegisteredPubkey(pubkey)) {
revert ErrDuplicatedPubkey(pubkey);
}
}

function _checkNonDuplicatedPubkey(bytes memory pubkey) internal view returns (bool) {
function _isRegisteredPubkey(bytes memory pubkey) internal view returns (bool) {
return _registry[_hashPubkey(pubkey)];
}
}

0 comments on commit 7e6391e

Please sign in to comment.