Skip to content

Commit

Permalink
fix emission for ipOrg config
Browse files Browse the repository at this point in the history
  • Loading branch information
Raul committed Dec 8, 2023
1 parent 2ad8bad commit d1b1d7f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
6 changes: 4 additions & 2 deletions contracts/interfaces/modules/licensing/ILicensingModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ interface ILicensingModule {
/// Emits when an IP org sets a parameter of a licensing framework.
/// @param ipOrg address of the IP org
/// @param paramTag the tag of the parameter
/// @param defaultValue the default value of the parameter
/// @param paramType the default value of the parameter
/// @param paramValue the type of the parameter
event ParameterSet(
address indexed ipOrg,
string paramTag,
bytes defaultValue
Licensing.ParameterType paramType,
bytes paramValue
);

/// Gets the licensing framework of an IP org.
Expand Down
15 changes: 8 additions & 7 deletions contracts/modules/licensing/LicensingModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,12 @@ contract LicensingModule is BaseModule, ILicensingModule {
ipOrgAddress
];
uint256 numParams = configParams.length;
emit IpOrgLicensingFrameworkSet(
ipOrgAddress,
config.frameworkId,
LICENSING_FRAMEWORK_REPO.getLicenseTextUrl(config.frameworkId),
config.licensor
);
// Add the parameters to storage
for (uint256 i = 0; i < numParams; i++) {
Licensing.ParamValue memory param = configParams[i];
Expand All @@ -413,14 +419,9 @@ contract LicensingModule is BaseModule, ILicensingModule {
revert Errors.LicensingModule_InvalidParamValue();
}
paramValues[param.tag] = param.value;
emit ParameterSet(ipOrgAddress, param.tag.toString(), param.value);
emit ParameterSet(ipOrgAddress, param.tag.toString(), paramDef.paramType, param.value);
}
emit IpOrgLicensingFrameworkSet(
ipOrgAddress,
config.frameworkId,
LICENSING_FRAMEWORK_REPO.getLicenseTextUrl(config.frameworkId),
config.licensor
);

return "";
}

Expand Down

0 comments on commit d1b1d7f

Please sign in to comment.