misc: Module data params used for initialization renamed to make them more explicit

This commit is contained in:
donosonaumczuk
2022-04-08 19:25:13 +01:00
parent fe4d929fbf
commit c969cf0bff
4 changed files with 36 additions and 36 deletions

View File

@@ -194,13 +194,13 @@ contract LensHub is LensNFTBase, VersionedInitializable, LensMultiState, LensHub
function setFollowModule(
uint256 profileId,
address followModule,
bytes calldata followModuleData
bytes calldata followModuleInitData
) external override whenNotPaused {
_validateCallerIsProfileOwner(profileId);
PublishingLogic.setFollowModule(
profileId,
followModule,
followModuleData,
followModuleInitData,
_profileById[profileId],
_followModuleWhitelisted
);
@@ -221,7 +221,7 @@ contract LensHub is LensNFTBase, VersionedInitializable, LensMultiState, LensHub
SET_FOLLOW_MODULE_WITH_SIG_TYPEHASH,
vars.profileId,
vars.followModule,
keccak256(vars.followModuleData),
keccak256(vars.followModuleInitData),
sigNonces[owner]++,
vars.sig.deadline
)
@@ -234,7 +234,7 @@ contract LensHub is LensNFTBase, VersionedInitializable, LensMultiState, LensHub
PublishingLogic.setFollowModule(
vars.profileId,
vars.followModule,
vars.followModuleData,
vars.followModuleInitData,
_profileById[vars.profileId],
_followModuleWhitelisted
);
@@ -360,9 +360,9 @@ contract LensHub is LensNFTBase, VersionedInitializable, LensMultiState, LensHub
vars.profileId,
vars.contentURI,
vars.collectModule,
vars.collectModuleData,
vars.collectModuleInitData,
vars.referenceModule,
vars.referenceModuleData
vars.referenceModuleInitData
);
}
@@ -383,9 +383,9 @@ contract LensHub is LensNFTBase, VersionedInitializable, LensMultiState, LensHub
vars.profileId,
keccak256(bytes(vars.contentURI)),
vars.collectModule,
keccak256(vars.collectModuleData),
keccak256(vars.collectModuleInitData),
vars.referenceModule,
keccak256(vars.referenceModuleData),
keccak256(vars.referenceModuleInitData),
sigNonces[owner]++,
vars.sig.deadline
)
@@ -400,9 +400,9 @@ contract LensHub is LensNFTBase, VersionedInitializable, LensMultiState, LensHub
vars.profileId,
vars.contentURI,
vars.collectModule,
vars.collectModuleData,
vars.collectModuleInitData,
vars.referenceModule,
vars.referenceModuleData
vars.referenceModuleInitData
);
}

View File

@@ -95,7 +95,7 @@ interface ILensHub {
* handle: The handle to set for the profile, must be unique and non-empty.
* imageURI: The URI to set for the profile image.
* followModule: The follow module to use, can be the zero address.
* followModuleData: The follow module initialization data, if any.
* followModuleInitData: The follow module initialization data, if any.
*/
function createProfile(DataTypes.CreateProfileData calldata vars) external returns (uint256);
@@ -119,12 +119,12 @@ interface ILensHub {
*
* @param profileId The token ID of the profile to set the follow module for.
* @param followModule The follow module to set for the given profile, must be whitelisted.
* @param followModuleData The data to be passed to the follow module for initialization.
* @param followModuleInitData The data to be passed to the follow module for initialization.
*/
function setFollowModule(
uint256 profileId,
address followModule,
bytes calldata followModuleData
bytes calldata followModuleInitData
) external;
/**

View File

@@ -97,7 +97,7 @@ library DataTypes {
* @param handle The handle to set for the profile, must be unique and non-empty.
* @param imageURI The URI to set for the profile image.
* @param followModule The follow module to use, can be the zero address.
* @param followModuleData The follow module initialization data, if any.
* @param followModuleInitData The follow module initialization data, if any.
* @param followNFTURI The URI to use for the follow NFT.
*/
struct CreateProfileData {
@@ -105,7 +105,7 @@ library DataTypes {
string handle;
string imageURI;
address followModule;
bytes followModuleData;
bytes followModuleInitData;
string followNFTURI;
}
@@ -129,13 +129,13 @@ library DataTypes {
*
* @param profileId The token ID of the profile to change the followModule for.
* @param followModule The followModule to set for the given profile, must be whitelisted.
* @param followModuleData The data to be passed to the followModule for initialization.
* @param followModuleInitData The data to be passed to the followModule for initialization.
* @param sig The EIP712Signature struct containing the profile owner's signature.
*/
struct SetFollowModuleWithSigData {
uint256 profileId;
address followModule;
bytes followModuleData;
bytes followModuleInitData;
EIP712Signature sig;
}
@@ -187,17 +187,17 @@ library DataTypes {
* @param profileId The token ID of the profile to publish to.
* @param contentURI The URI to set for this new publication.
* @param collectModule The collect module to set for this new publication.
* @param collectModuleData The data to pass to the collect module's initialization.
* @param collectModuleInitData The data to pass to the collect module's initialization.
* @param referenceModule The reference module to set for the given publication, must be whitelisted.
* @param referenceModuleData The data to be passed to the reference module for initialization.
* @param referenceModuleInitData The data to be passed to the reference module for initialization.
*/
struct PostData {
uint256 profileId;
string contentURI;
address collectModule;
bytes collectModuleData;
bytes collectModuleInitData;
address referenceModule;
bytes referenceModuleData;
bytes referenceModuleInitData;
}
/**
@@ -207,18 +207,18 @@ library DataTypes {
* @param profileId The token ID of the profile to publish to.
* @param contentURI The URI to set for this new publication.
* @param collectModule The collectModule to set for this new publication.
* @param collectModuleData The data to pass to the collectModule's initialization.
* @param collectModuleInitData The data to pass to the collectModule's initialization.
* @param referenceModule The reference module to set for the given publication, must be whitelisted.
* @param referenceModuleData The data to be passed to the reference module for initialization.
* @param referenceModuleInitData The data to be passed to the reference module for initialization.
* @param sig The EIP712Signature struct containing the profile owner's signature.
*/
struct PostWithSigData {
uint256 profileId;
string contentURI;
address collectModule;
bytes collectModuleData;
bytes collectModuleInitData;
address referenceModule;
bytes referenceModuleData;
bytes referenceModuleInitData;
EIP712Signature sig;
}

View File

@@ -29,7 +29,7 @@ library PublishingLogic {
* handle: The handle to set for the profile, must be unique and non-empty.
* imageURI: The URI to set for the profile image.
* followModule: The follow module to use, can be the zero address.
* followModuleData: The follow module initialization data, if any
* followModuleInitData: The follow module initialization data, if any
* followNFTURI: The URI to set for the follow NFT.
* @param profileId The profile ID to associate with this profile NFT (token ID).
* @param _profileIdByHandleHash The storage reference to the mapping of profile IDs by handle hash.
@@ -60,7 +60,7 @@ library PublishingLogic {
followModuleReturnData = _initFollowModule(
profileId,
vars.followModule,
vars.followModuleData,
vars.followModuleInitData,
_followModuleWhitelisted
);
}
@@ -73,14 +73,14 @@ library PublishingLogic {
*
* @param profileId The profile ID to set the follow module for.
* @param followModule The follow module to set for the given profile, if any.
* @param followModuleData The data to pass to the follow module for profile initialization.
* @param followModuleInitData The data to pass to the follow module for profile initialization.
* @param _profile The storage reference to the profile struct associated with the given profile ID.
* @param _followModuleWhitelisted The storage reference to the mapping of whitelist status by follow module address.
*/
function setFollowModule(
uint256 profileId,
address followModule,
bytes calldata followModuleData,
bytes calldata followModuleInitData,
DataTypes.ProfileStruct storage _profile,
mapping(address => bool) storage _followModuleWhitelisted
) external {
@@ -93,7 +93,7 @@ library PublishingLogic {
followModuleReturnData = _initFollowModule(
profileId,
followModule,
followModuleData,
followModuleInitData,
_followModuleWhitelisted
);
emit Events.FollowModuleSet(
@@ -300,7 +300,7 @@ library PublishingLogic {
uint256 profileId,
uint256 pubId,
address collectModule,
bytes memory collectModuleData,
bytes memory collectModuleInitData,
mapping(uint256 => mapping(uint256 => DataTypes.PublicationStruct))
storage _pubByIdByProfile,
mapping(address => bool) storage _collectModuleWhitelisted
@@ -311,7 +311,7 @@ library PublishingLogic {
ICollectModule(collectModule).initializePublicationCollectModule(
profileId,
pubId,
collectModuleData
collectModuleInitData
);
}
@@ -319,7 +319,7 @@ library PublishingLogic {
uint256 profileId,
uint256 pubId,
address referenceModule,
bytes memory referenceModuleData,
bytes memory referenceModuleInitData,
mapping(uint256 => mapping(uint256 => DataTypes.PublicationStruct))
storage _pubByIdByProfile,
mapping(address => bool) storage _referenceModuleWhitelisted
@@ -332,18 +332,18 @@ library PublishingLogic {
IReferenceModule(referenceModule).initializeReferenceModule(
profileId,
pubId,
referenceModuleData
referenceModuleInitData
);
}
function _initFollowModule(
uint256 profileId,
address followModule,
bytes memory followModuleData,
bytes memory followModuleInitData,
mapping(address => bool) storage _followModuleWhitelisted
) private returns (bytes memory) {
if (!_followModuleWhitelisted[followModule]) revert Errors.FollowModuleNotWhitelisted();
return IFollowModule(followModule).initializeFollowModule(profileId, followModuleData);
return IFollowModule(followModule).initializeFollowModule(profileId, followModuleInitData);
}
function _emitCommentCreated(