misc: Action module enabled getter added

This commit is contained in:
donosonaumczuk
2023-09-11 19:57:37 +01:00
parent f3fa90bd69
commit 917ea6da56
2 changed files with 24 additions and 0 deletions

View File

@@ -540,6 +540,15 @@ contract LensHub is
return StorageLib.getPublicationMemory(profileId, pubId);
}
/// @inheritdoc ILensProtocol
function isActionModuleEnabledInPublication(
uint256 profileId,
uint256 pubId,
address module
) external view returns (bool) {
return StorageLib.getPublication(profileId, pubId).actionModuleEnabled[module];
}
/// @inheritdoc ILensProtocol
function getPublicationType(
uint256 profileId,

View File

@@ -450,4 +450,19 @@ interface ILensProtocol {
* @return PublicationType The publication type of the queried publication.
*/
function getPublicationType(uint256 profileId, uint256 pubId) external view returns (Types.PublicationType);
/**
* @notice Returns wether a given Action Module is enabled for a given publication.
*
* @param profileId The token ID of the profile that published the publication to query.
* @param pubId The publication ID of the publication to query.
* @param module The address of the Action Module to query.
*
* @return bool True if the Action Module is enabled for the queried publication, false if not.
*/
function isActionModuleEnabledInPublication(
uint256 profileId,
uint256 pubId,
address module
) external view returns (bool);
}