Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramarti committed May 29, 2024
1 parent b2b1e82 commit 90ab07f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion contracts/modules/licensing/LicensingModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ contract LicensingModule is
address licenseTemplate,
uint256 licenseTermsId,
Licensing.LicensingConfig memory licensingConfig
) external verifyPermission(ipId) {
) external verifyPermission(ipId) whenNotPaused {
if (
licensingConfig.licensingHook != address(0) &&
(!licensingConfig.licensingHook.supportsInterface(type(ILicensingHook).interfaceId) ||
Expand Down
20 changes: 20 additions & 0 deletions test/foundry/modules/licensing/LicensingModule.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,7 @@ contract LicensingModuleTest is BaseTest {
function test_LicensingModule_registerDerivativeWithLicenseTokens_revert_pause() public {
uint256 termsId = pilTemplate.registerLicenseTerms(PILFlavors.nonCommercialSocialRemixing());
vm.prank(ipOwner1);

licensingModule.attachLicenseTerms(ipId1, address(pilTemplate), termsId);

uint256 lcTokenId = licensingModule.mintLicenseTokens({
Expand Down Expand Up @@ -1275,6 +1276,25 @@ contract LicensingModuleTest is BaseTest {
licensingModule.setLicensingConfig(ipId1, address(pilTemplate), 0, licensingConfig);
}

function test_LicensingModule_setLicensingConfig_revert_paused() public {
vm.prank(u.admin);
licensingModule.pause();

uint256 socialRemixTermsId = pilTemplate.registerLicenseTerms(PILFlavors.nonCommercialSocialRemixing());
MockLicensingHook licensingHook = new MockLicensingHook();
vm.prank(admin);
moduleRegistry.registerModule("MockLicensingHook", address(licensingHook));
Licensing.LicensingConfig memory licensingConfig = Licensing.LicensingConfig({
isSet: true,
mintingFee: 100,
licensingHook: address(licensingHook),
hookData: abi.encode(address(0x123))
});
vm.expectRevert(abi.encodeWithSelector(PausableUpgradeable.EnforcedPause.selector));
vm.prank(ipOwner1);
licensingModule.setLicensingConfig(ipId1, address(pilTemplate), socialRemixTermsId, licensingConfig);
}

function test_LicensingModule_mintLicenseTokens_revert_licensingHookRevert() public {
uint256 termsId = pilTemplate.registerLicenseTerms(PILFlavors.defaultValuesLicenseTerms());
MockLicensingHook licensingHook = new MockLicensingHook();
Expand Down

0 comments on commit 90ab07f

Please sign in to comment.