Skip to content

Commit

Permalink
rename exists function
Browse files Browse the repository at this point in the history
  • Loading branch information
kingster-will committed Apr 6, 2024
1 parent f2ea03c commit 15b0b9c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ interface ILicenseTemplate is IERC165 {
/// @notice Checks if a license terms exists.
/// @param licenseTermsId The ID of the license terms.
/// @return True if the license terms exists, false otherwise.
function isLicenseTermsPresent(uint256 licenseTermsId) external view returns (bool);
function exists(uint256 licenseTermsId) external view returns (bool);

/// @notice Checks if a license terms is transferable.
/// @param licenseTermsId The ID of the license terms.
Expand Down
2 changes: 1 addition & 1 deletion contracts/modules/licensing/PILicenseTemplate.sol
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ contract PILicenseTemplate is
/// @notice Checks if a license terms exists.
/// @param licenseTermsId The ID of the license terms.
/// @return True if the license terms exists, false otherwise.
function isLicenseTermsPresent(uint256 licenseTermsId) external view override returns (bool) {
function exists(uint256 licenseTermsId) external view override returns (bool) {
PILicenseTemplateStorage storage $ = _getPILicenseTemplateStorage();
return licenseTermsId <= $.licenseTermsCounter;
}
Expand Down
2 changes: 1 addition & 1 deletion contracts/registries/LicenseRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ contract LicenseRegistry is ILicenseRegistry, GovernableUpgradeable, UUPSUpgrade
if (!_getLicenseRegistryStorage().registeredLicenseTemplates[licenseTemplate]) {
return false;
}
return ILicenseTemplate(licenseTemplate).isLicenseTermsPresent(licenseTermsId);
return ILicenseTemplate(licenseTemplate).exists(licenseTermsId);
}

////////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 2 additions & 2 deletions test/foundry/integration/e2e/e2e.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,9 @@ contract e2e is Test {
),
2
);
assertTrue(piLicenseTemplate.isLicenseTermsPresent(2));
assertTrue(piLicenseTemplate.exists(2));

assertTrue(piLicenseTemplate.isLicenseTermsPresent(lcId2));
assertTrue(piLicenseTemplate.exists(lcId2));

// attach licenses
vm.startPrank(alice);
Expand Down

0 comments on commit 15b0b9c

Please sign in to comment.