mirror of
https://github.com/lens-protocol/core.git
synced 2026-01-09 14:18:04 -05:00
fix: Fixed tests and updated typehashes.
This commit is contained in:
@@ -19,7 +19,7 @@ abstract contract LensHubStorage {
|
||||
);
|
||||
bytes32 internal constant SET_FOLLOW_MODULE_WITH_SIG_TYPEHASH =
|
||||
keccak256(
|
||||
'SetFollowModuleWithSig(uint256 profileId,address followModule,bytes followModuleData,uint256 nonce,uint256 deadline)'
|
||||
'SetFollowModuleWithSig(uint256 profileId,address followModule,bytes followModuleInitData,uint256 nonce,uint256 deadline)'
|
||||
);
|
||||
bytes32 internal constant SET_FOLLOW_NFT_URI_WITH_SIG_TYPEHASH =
|
||||
keccak256(
|
||||
@@ -35,15 +35,15 @@ abstract contract LensHubStorage {
|
||||
);
|
||||
bytes32 internal constant POST_WITH_SIG_TYPEHASH =
|
||||
keccak256(
|
||||
'PostWithSig(uint256 profileId,string contentURI,address collectModule,bytes collectModuleData,address referenceModule,bytes referenceModuleData,uint256 nonce,uint256 deadline)'
|
||||
'PostWithSig(uint256 profileId,string contentURI,address collectModule,bytes collectModuleInitData,address referenceModule,bytes referenceModuleInitData,uint256 nonce,uint256 deadline)'
|
||||
);
|
||||
bytes32 internal constant COMMENT_WITH_SIG_TYPEHASH =
|
||||
keccak256(
|
||||
'CommentWithSig(uint256 profileId,string contentURI,uint256 profileIdPointed,uint256 pubIdPointed,address collectModule,bytes collectModuleData,address referenceModule,bytes referenceModuleData,uint256 nonce,uint256 deadline)'
|
||||
'CommentWithSig(uint256 profileId,string contentURI,uint256 profileIdPointed,uint256 pubIdPointed,bytes referenceModuleData,address collectModule,bytes collectModuleInitData,address referenceModule,bytes referenceModuleInitData,uint256 nonce,uint256 deadline)'
|
||||
);
|
||||
bytes32 internal constant MIRROR_WITH_SIG_TYPEHASH =
|
||||
keccak256(
|
||||
'MirrorWithSig(uint256 profileId,uint256 profileIdPointed,uint256 pubIdPointed,address referenceModule,bytes referenceModuleData,uint256 nonce,uint256 deadline)'
|
||||
'MirrorWithSig(uint256 profileId,uint256 profileIdPointed,uint256 pubIdPointed,bytes referenceModuleData,address referenceModule,bytes referenceModuleInitData,uint256 nonce,uint256 deadline)'
|
||||
);
|
||||
bytes32 internal constant FOLLOW_WITH_SIG_TYPEHASH =
|
||||
keccak256(
|
||||
|
||||
@@ -316,14 +316,14 @@ const buildDelegateBySigParams = (
|
||||
export async function getSetFollowModuleWithSigParts(
|
||||
profileId: BigNumberish,
|
||||
followModule: string,
|
||||
followModuleData: Bytes | string,
|
||||
followModuleInitData: Bytes | string,
|
||||
nonce: number,
|
||||
deadline: string
|
||||
): Promise<{ v: number; r: string; s: string }> {
|
||||
const msgParams = buildSetFollowModuleWithSigParams(
|
||||
profileId,
|
||||
followModule,
|
||||
followModuleData,
|
||||
followModuleInitData,
|
||||
nonce,
|
||||
deadline
|
||||
);
|
||||
@@ -374,9 +374,9 @@ export async function getPostWithSigParts(
|
||||
profileId: BigNumberish,
|
||||
contentURI: string,
|
||||
collectModule: string,
|
||||
collectModuleData: Bytes | string,
|
||||
collectModuleInitData: Bytes | string,
|
||||
referenceModule: string,
|
||||
referenceModuleData: Bytes | string,
|
||||
referenceModuleInitData: Bytes | string,
|
||||
nonce: number,
|
||||
deadline: string
|
||||
): Promise<{ v: number; r: string; s: string }> {
|
||||
@@ -384,9 +384,9 @@ export async function getPostWithSigParts(
|
||||
profileId,
|
||||
contentURI,
|
||||
collectModule,
|
||||
collectModuleData,
|
||||
collectModuleInitData,
|
||||
referenceModule,
|
||||
referenceModuleData,
|
||||
referenceModuleInitData,
|
||||
nonce,
|
||||
deadline
|
||||
);
|
||||
@@ -398,10 +398,11 @@ export async function getCommentWithSigParts(
|
||||
contentURI: string,
|
||||
profileIdPointed: BigNumberish,
|
||||
pubIdPointed: string,
|
||||
collectModule: string,
|
||||
collectModuleData: Bytes | string,
|
||||
referenceModule: string,
|
||||
referenceModuleData: Bytes | string,
|
||||
collectModule: string,
|
||||
collectModuleInitData: Bytes | string,
|
||||
referenceModule: string,
|
||||
referenceModuleInitData: Bytes | string,
|
||||
nonce: number,
|
||||
deadline: string
|
||||
): Promise<{ v: number; r: string; s: string }> {
|
||||
@@ -410,10 +411,11 @@ export async function getCommentWithSigParts(
|
||||
contentURI,
|
||||
profileIdPointed,
|
||||
pubIdPointed,
|
||||
collectModule,
|
||||
collectModuleData,
|
||||
referenceModule,
|
||||
referenceModuleData,
|
||||
collectModule,
|
||||
collectModuleInitData,
|
||||
referenceModule,
|
||||
referenceModuleInitData,
|
||||
nonce,
|
||||
deadline
|
||||
);
|
||||
@@ -424,8 +426,9 @@ export async function getMirrorWithSigParts(
|
||||
profileId: BigNumberish,
|
||||
profileIdPointed: BigNumberish,
|
||||
pubIdPointed: string,
|
||||
referenceModule: string,
|
||||
referenceModuleData: Bytes | string,
|
||||
referenceModule: string,
|
||||
referenceModuleInitData: Bytes | string,
|
||||
nonce: number,
|
||||
deadline: string
|
||||
): Promise<{ v: number; r: string; s: string }> {
|
||||
@@ -433,8 +436,9 @@ export async function getMirrorWithSigParts(
|
||||
profileId,
|
||||
profileIdPointed,
|
||||
pubIdPointed,
|
||||
referenceModule,
|
||||
referenceModuleData,
|
||||
referenceModule,
|
||||
referenceModuleInitData,
|
||||
nonce,
|
||||
deadline
|
||||
);
|
||||
@@ -760,7 +764,7 @@ const buildBurnWithSigParams = (
|
||||
const buildSetFollowModuleWithSigParams = (
|
||||
profileId: BigNumberish,
|
||||
followModule: string,
|
||||
followModuleData: Bytes | string,
|
||||
followModuleInitData: Bytes | string,
|
||||
nonce: number,
|
||||
deadline: string
|
||||
) => ({
|
||||
@@ -768,7 +772,7 @@ const buildSetFollowModuleWithSigParams = (
|
||||
SetFollowModuleWithSig: [
|
||||
{ name: 'profileId', type: 'uint256' },
|
||||
{ name: 'followModule', type: 'address' },
|
||||
{ name: 'followModuleData', type: 'bytes' },
|
||||
{ name: 'followModuleInitData', type: 'bytes' },
|
||||
{ name: 'nonce', type: 'uint256' },
|
||||
{ name: 'deadline', type: 'uint256' },
|
||||
],
|
||||
@@ -777,7 +781,7 @@ const buildSetFollowModuleWithSigParams = (
|
||||
value: {
|
||||
profileId: profileId,
|
||||
followModule: followModule,
|
||||
followModuleData: followModuleData,
|
||||
followModuleInitData: followModuleInitData,
|
||||
nonce: nonce,
|
||||
deadline: deadline,
|
||||
},
|
||||
@@ -879,9 +883,9 @@ const buildPostWithSigParams = (
|
||||
profileId: BigNumberish,
|
||||
contentURI: string,
|
||||
collectModule: string,
|
||||
collectModuleData: Bytes | string,
|
||||
collectModuleInitData: Bytes | string,
|
||||
referenceModule: string,
|
||||
referenceModuleData: Bytes | string,
|
||||
referenceModuleInitData: Bytes | string,
|
||||
nonce: number,
|
||||
deadline: string
|
||||
) => ({
|
||||
@@ -890,9 +894,9 @@ const buildPostWithSigParams = (
|
||||
{ name: 'profileId', type: 'uint256' },
|
||||
{ name: 'contentURI', type: 'string' },
|
||||
{ name: 'collectModule', type: 'address' },
|
||||
{ name: 'collectModuleData', type: 'bytes' },
|
||||
{ name: 'collectModuleInitData', type: 'bytes' },
|
||||
{ name: 'referenceModule', type: 'address' },
|
||||
{ name: 'referenceModuleData', type: 'bytes' },
|
||||
{ name: 'referenceModuleInitData', type: 'bytes' },
|
||||
{ name: 'nonce', type: 'uint256' },
|
||||
{ name: 'deadline', type: 'uint256' },
|
||||
],
|
||||
@@ -902,9 +906,9 @@ const buildPostWithSigParams = (
|
||||
profileId: profileId,
|
||||
contentURI: contentURI,
|
||||
collectModule: collectModule,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: referenceModule,
|
||||
referenceModuleData: referenceModuleData,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
nonce: nonce,
|
||||
deadline: deadline,
|
||||
},
|
||||
@@ -915,10 +919,11 @@ const buildCommentWithSigParams = (
|
||||
contentURI: string,
|
||||
profileIdPointed: BigNumberish,
|
||||
pubIdPointed: string,
|
||||
collectModule: string,
|
||||
collectModuleData: Bytes | string,
|
||||
referenceModule: string,
|
||||
referenceModuleData: Bytes | string,
|
||||
collectModule: string,
|
||||
collectModuleInitData: Bytes | string,
|
||||
referenceModule: string,
|
||||
referenceModuleInitData: Bytes | string,
|
||||
nonce: number,
|
||||
deadline: string
|
||||
) => ({
|
||||
@@ -928,10 +933,11 @@ const buildCommentWithSigParams = (
|
||||
{ name: 'contentURI', type: 'string' },
|
||||
{ name: 'profileIdPointed', type: 'uint256' },
|
||||
{ name: 'pubIdPointed', type: 'uint256' },
|
||||
{ name: 'collectModule', type: 'address' },
|
||||
{ name: 'collectModuleData', type: 'bytes' },
|
||||
{ name: 'referenceModule', type: 'address' },
|
||||
{ name: 'referenceModuleData', type: 'bytes' },
|
||||
{ name: 'collectModule', type: 'address' },
|
||||
{ name: 'collectModuleInitData', type: 'bytes' },
|
||||
{ name: 'referenceModule', type: 'address' },
|
||||
{ name: 'referenceModuleInitData', type: 'bytes' },
|
||||
{ name: 'nonce', type: 'uint256' },
|
||||
{ name: 'deadline', type: 'uint256' },
|
||||
],
|
||||
@@ -942,10 +948,11 @@ const buildCommentWithSigParams = (
|
||||
contentURI: contentURI,
|
||||
profileIdPointed: profileIdPointed,
|
||||
pubIdPointed: pubIdPointed,
|
||||
collectModule: collectModule,
|
||||
collectModuleData: collectModuleData,
|
||||
referenceModule: referenceModule,
|
||||
referenceModuleData: referenceModuleData,
|
||||
collectModule: collectModule,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: referenceModule,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
nonce: nonce,
|
||||
deadline: deadline,
|
||||
},
|
||||
@@ -955,8 +962,9 @@ const buildMirrorWithSigParams = (
|
||||
profileId: BigNumberish,
|
||||
profileIdPointed: BigNumberish,
|
||||
pubIdPointed: string,
|
||||
referenceModule: string,
|
||||
referenceModuleData: Bytes | string,
|
||||
referenceModule: string,
|
||||
referenceModuleInitData: Bytes | string,
|
||||
nonce: number,
|
||||
deadline: string
|
||||
) => ({
|
||||
@@ -965,8 +973,9 @@ const buildMirrorWithSigParams = (
|
||||
{ name: 'profileId', type: 'uint256' },
|
||||
{ name: 'profileIdPointed', type: 'uint256' },
|
||||
{ name: 'pubIdPointed', type: 'uint256' },
|
||||
{ name: 'referenceModule', type: 'address' },
|
||||
{ name: 'referenceModuleData', type: 'bytes' },
|
||||
{ name: 'referenceModule', type: 'address' },
|
||||
{ name: 'referenceModuleInitData', type: 'bytes' },
|
||||
{ name: 'nonce', type: 'uint256' },
|
||||
{ name: 'deadline', type: 'uint256' },
|
||||
],
|
||||
@@ -976,8 +985,9 @@ const buildMirrorWithSigParams = (
|
||||
profileId: profileId,
|
||||
profileIdPointed: profileIdPointed,
|
||||
pubIdPointed: pubIdPointed,
|
||||
referenceModule: referenceModule,
|
||||
referenceModuleData: referenceModuleData,
|
||||
referenceModule: referenceModule,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
nonce: nonce,
|
||||
deadline: deadline,
|
||||
},
|
||||
|
||||
@@ -39,7 +39,7 @@ makeSuiteCleanRoom('Collecting', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -48,9 +48,9 @@ makeSuiteCleanRoom('Collecting', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
});
|
||||
@@ -198,7 +198,7 @@ makeSuiteCleanRoom('Collecting', function () {
|
||||
handle: 'mockhandle',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -208,8 +208,9 @@ makeSuiteCleanRoom('Collecting', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -241,7 +242,7 @@ makeSuiteCleanRoom('Collecting', function () {
|
||||
handle: 'mockhandle',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -251,8 +252,9 @@ makeSuiteCleanRoom('Collecting', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -261,8 +263,9 @@ makeSuiteCleanRoom('Collecting', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: secondProfileId,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -478,7 +481,7 @@ makeSuiteCleanRoom('Collecting', function () {
|
||||
handle: 'mockhandle',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -488,8 +491,9 @@ makeSuiteCleanRoom('Collecting', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ makeSuiteCleanRoom('Following', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -104,7 +104,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -124,7 +124,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.PAUSED);
|
||||
@@ -139,7 +139,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -152,7 +152,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -179,7 +179,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -200,7 +200,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
lensHub.setFollowModuleWithSig({
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -218,7 +218,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
lensHub.setFollowModuleWithSig({
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -236,7 +236,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -261,7 +261,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -314,7 +314,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -339,7 +339,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -392,7 +392,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -417,7 +417,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -470,7 +470,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -486,9 +486,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.PUBLISHING_PAUSED);
|
||||
|
||||
@@ -501,9 +501,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
});
|
||||
@@ -515,7 +515,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -527,16 +527,16 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
).to.not.be.reverted;
|
||||
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const collectModuleData = abiCoder.encode(['bool'], [true]);
|
||||
const collectModuleInitData = abiCoder.encode(['bool'], [true]);
|
||||
const referenceModuleInitData = [];
|
||||
const referenceModuleData = [];
|
||||
|
||||
const { v, r, s } = await getPostWithSigParts(
|
||||
FIRST_PROFILE_ID,
|
||||
MOCK_URI,
|
||||
freeCollectModule.address,
|
||||
collectModuleData,
|
||||
collectModuleInitData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleData,
|
||||
referenceModuleInitData,
|
||||
nonce,
|
||||
MAX_UINT256
|
||||
);
|
||||
@@ -546,9 +546,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -567,9 +567,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -587,7 +587,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -601,9 +601,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -615,10 +615,11 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
contentURI: MOCK_URI,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.PUBLISHING_PAUSED);
|
||||
|
||||
@@ -632,10 +633,11 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
contentURI: MOCK_URI,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
});
|
||||
@@ -647,7 +649,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -661,16 +663,17 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
await expect(lensHub.connect(governance).setState(ProtocolState.Paused)).to.not.be.reverted;
|
||||
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const collectModuleData = abiCoder.encode(['bool'], [true]);
|
||||
const collectModuleInitData = abiCoder.encode(['bool'], [true]);
|
||||
const referenceModuleInitData = [];
|
||||
const referenceModuleData = [];
|
||||
|
||||
const { v, r, s } = await getCommentWithSigParts(
|
||||
@@ -678,10 +681,11 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
MOCK_URI,
|
||||
FIRST_PROFILE_ID,
|
||||
'1',
|
||||
freeCollectModule.address,
|
||||
collectModuleData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleData,
|
||||
freeCollectModule.address,
|
||||
collectModuleInitData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleInitData,
|
||||
nonce,
|
||||
MAX_UINT256
|
||||
);
|
||||
@@ -692,10 +696,11 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
contentURI: MOCK_URI,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: '1',
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -715,10 +720,11 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
contentURI: MOCK_URI,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: '1',
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -736,7 +742,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -750,9 +756,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -763,8 +769,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.PUBLISHING_PAUSED);
|
||||
|
||||
@@ -777,8 +784,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
});
|
||||
@@ -790,7 +798,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -804,23 +812,25 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
await expect(lensHub.connect(governance).setState(ProtocolState.Paused)).to.not.be.reverted;
|
||||
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const referenceModuleInitData = [];
|
||||
const referenceModuleData = [];
|
||||
|
||||
const { v, r, s } = await getMirrorWithSigParts(
|
||||
FIRST_PROFILE_ID,
|
||||
FIRST_PROFILE_ID,
|
||||
'1',
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleInitData,
|
||||
nonce,
|
||||
MAX_UINT256
|
||||
);
|
||||
@@ -830,8 +840,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: '1',
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -850,8 +861,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: '1',
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -869,7 +881,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -892,7 +904,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -915,7 +927,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -971,7 +983,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -985,9 +997,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -1011,7 +1023,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -1025,9 +1037,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -1097,7 +1109,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -1110,7 +1122,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -1131,7 +1143,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -1154,7 +1166,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
lensHub.setFollowModuleWithSig({
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -1172,7 +1184,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -1191,7 +1203,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -1229,7 +1241,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -1248,7 +1260,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -1286,7 +1298,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -1304,9 +1316,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.PUBLISHING_PAUSED);
|
||||
|
||||
@@ -1319,9 +1331,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
});
|
||||
@@ -1333,7 +1345,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -1347,16 +1359,16 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
).to.not.be.reverted;
|
||||
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const collectModuleData = abiCoder.encode(['bool'], [true]);
|
||||
const collectModuleInitData = abiCoder.encode(['bool'], [true]);
|
||||
const referenceModuleInitData = [];
|
||||
const referenceModuleData = [];
|
||||
|
||||
const { v, r, s } = await getPostWithSigParts(
|
||||
FIRST_PROFILE_ID,
|
||||
MOCK_URI,
|
||||
freeCollectModule.address,
|
||||
collectModuleData,
|
||||
collectModuleInitData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleData,
|
||||
referenceModuleInitData,
|
||||
nonce,
|
||||
MAX_UINT256
|
||||
);
|
||||
@@ -1366,9 +1378,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -1387,9 +1399,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -1407,7 +1419,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -1421,9 +1433,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -1437,10 +1449,11 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
contentURI: MOCK_URI,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.PUBLISHING_PAUSED);
|
||||
|
||||
@@ -1454,10 +1467,11 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
contentURI: MOCK_URI,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
});
|
||||
@@ -1469,7 +1483,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -1483,9 +1497,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -1494,7 +1508,8 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
).to.not.be.reverted;
|
||||
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const collectModuleData = abiCoder.encode(['bool'], [true]);
|
||||
const collectModuleInitData = abiCoder.encode(['bool'], [true]);
|
||||
const referenceModuleInitData = [];
|
||||
const referenceModuleData = [];
|
||||
|
||||
const { v, r, s } = await getCommentWithSigParts(
|
||||
@@ -1502,10 +1517,11 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
MOCK_URI,
|
||||
FIRST_PROFILE_ID,
|
||||
'1',
|
||||
freeCollectModule.address,
|
||||
collectModuleData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleData,
|
||||
freeCollectModule.address,
|
||||
collectModuleInitData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleInitData,
|
||||
nonce,
|
||||
MAX_UINT256
|
||||
);
|
||||
@@ -1516,10 +1532,11 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
contentURI: MOCK_URI,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: '1',
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -1539,10 +1556,11 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
contentURI: MOCK_URI,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: '1',
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -1560,7 +1578,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -1574,9 +1592,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -1589,8 +1607,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.PUBLISHING_PAUSED);
|
||||
|
||||
@@ -1603,8 +1622,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
});
|
||||
@@ -1616,7 +1636,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -1630,9 +1650,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -1641,14 +1661,16 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
).to.not.be.reverted;
|
||||
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const referenceModuleInitData = [];
|
||||
const referenceModuleData = [];
|
||||
|
||||
const { v, r, s } = await getMirrorWithSigParts(
|
||||
FIRST_PROFILE_ID,
|
||||
FIRST_PROFILE_ID,
|
||||
'1',
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleInitData,
|
||||
nonce,
|
||||
MAX_UINT256
|
||||
);
|
||||
@@ -1658,8 +1680,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: '1',
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -1678,8 +1701,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: '1',
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -1697,7 +1721,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -1716,7 +1740,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -1735,7 +1759,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -1775,7 +1799,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -1789,9 +1813,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -1811,7 +1835,7 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -1825,9 +1849,9 @@ makeSuiteCleanRoom('Multi-State Hub', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -58,9 +58,9 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
});
|
||||
@@ -74,9 +74,10 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
collectModule: ZERO_ADDRESS,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.NOT_PROFILE_OWNER_OR_DISPATCHER);
|
||||
});
|
||||
@@ -89,9 +90,10 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
collectModule: ZERO_ADDRESS,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.COLLECT_MODULE_NOT_WHITELISTED);
|
||||
});
|
||||
@@ -103,10 +105,11 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
contentURI: MOCK_URI,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: userAddress,
|
||||
referenceModuleData: [],
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: userAddress,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.REFERENCE_MODULE_NOT_WHITELISTED);
|
||||
});
|
||||
@@ -119,9 +122,10 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
collectModule: timedFeeCollectModule.address,
|
||||
collectModuleData: [0x2, 0x12, 0x20],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
collectModuleInitData: [0x2, 0x12, 0x20],
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.NO_REASON_ABI_DECODE);
|
||||
});
|
||||
@@ -133,10 +137,11 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
contentURI: MOCK_URI,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModuleData: [],
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: mockReferenceModule.address,
|
||||
referenceModuleData: [0x12, 0x23],
|
||||
referenceModuleInitData: [0x12, 0x23],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.NO_REASON_ABI_DECODE);
|
||||
});
|
||||
@@ -149,9 +154,10 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 3,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.PUBLICATION_DOES_NOT_EXIST);
|
||||
});
|
||||
@@ -164,9 +170,10 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 2,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.CANNOT_COMMENT_ON_SELF);
|
||||
});
|
||||
@@ -180,10 +187,11 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
contentURI: MOCK_URI,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -203,7 +211,7 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
handle: 'testwallet',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -213,23 +221,26 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const collectModuleData = abiCoder.encode(['bool'], [true]);
|
||||
const collectModuleInitData = abiCoder.encode(['bool'], [true]);
|
||||
const referenceModuleInitData = [];
|
||||
const referenceModuleData = [];
|
||||
|
||||
const { v, r, s } = await getCommentWithSigParts(
|
||||
FIRST_PROFILE_ID + 1,
|
||||
OTHER_MOCK_URI,
|
||||
FIRST_PROFILE_ID,
|
||||
'1',
|
||||
freeCollectModule.address,
|
||||
collectModuleData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleData,
|
||||
freeCollectModule.address,
|
||||
collectModuleInitData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleInitData,
|
||||
nonce,
|
||||
MAX_UINT256
|
||||
);
|
||||
@@ -241,9 +252,10 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: '1',
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -263,9 +275,10 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
},
|
||||
})
|
||||
).to.eq(1);
|
||||
@@ -279,9 +292,10 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
},
|
||||
})
|
||||
).to.eq(2);
|
||||
@@ -294,9 +308,10 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
},
|
||||
})
|
||||
).to.eq(2);
|
||||
@@ -309,9 +324,9 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: mockReferenceModule.address,
|
||||
referenceModuleData: data,
|
||||
referenceModuleInitData: data,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -320,11 +335,12 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 2,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
});
|
||||
@@ -339,7 +355,7 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -353,9 +369,9 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
});
|
||||
@@ -363,7 +379,8 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
context('Negatives', function () {
|
||||
it('Testwallet should fail to comment with sig with signature deadline mismatch', async function () {
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const collectModuleData = abiCoder.encode(['bool'], [true]);
|
||||
const collectModuleInitData = abiCoder.encode(['bool'], [true]);
|
||||
const referenceModuleInitData = [];
|
||||
const referenceModuleData = [];
|
||||
|
||||
const { v, r, s } = await getCommentWithSigParts(
|
||||
@@ -371,10 +388,11 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
MOCK_URI,
|
||||
FIRST_PROFILE_ID,
|
||||
'1',
|
||||
ZERO_ADDRESS,
|
||||
collectModuleData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleData,
|
||||
ZERO_ADDRESS,
|
||||
collectModuleInitData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleInitData,
|
||||
nonce,
|
||||
'0'
|
||||
);
|
||||
@@ -385,10 +403,11 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
contentURI: MOCK_URI,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: '1',
|
||||
collectModule: ZERO_ADDRESS,
|
||||
collectModuleData: collectModuleData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
collectModule: ZERO_ADDRESS,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -401,7 +420,8 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
|
||||
it('Testwallet should fail to comment with sig with invalid deadline', async function () {
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const collectModuleData = [];
|
||||
const collectModuleInitData = [];
|
||||
const referenceModuleInitData = [];
|
||||
const referenceModuleData = [];
|
||||
|
||||
const { v, r, s } = await getCommentWithSigParts(
|
||||
@@ -409,10 +429,11 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
MOCK_URI,
|
||||
FIRST_PROFILE_ID,
|
||||
'1',
|
||||
ZERO_ADDRESS,
|
||||
collectModuleData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleData,
|
||||
ZERO_ADDRESS,
|
||||
collectModuleInitData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleInitData,
|
||||
nonce,
|
||||
'0'
|
||||
);
|
||||
@@ -423,10 +444,11 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
contentURI: MOCK_URI,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: '1',
|
||||
collectModule: ZERO_ADDRESS,
|
||||
collectModuleData: collectModuleData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
collectModule: ZERO_ADDRESS,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -439,7 +461,8 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
|
||||
it('Testwallet should fail to comment with sig with invalid nonce', async function () {
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const collectModuleData = [];
|
||||
const collectModuleInitData = [];
|
||||
const referenceModuleInitData = [];
|
||||
const referenceModuleData = [];
|
||||
|
||||
const { v, r, s } = await getCommentWithSigParts(
|
||||
@@ -447,10 +470,11 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
MOCK_URI,
|
||||
FIRST_PROFILE_ID,
|
||||
'1',
|
||||
ZERO_ADDRESS,
|
||||
collectModuleData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleData,
|
||||
ZERO_ADDRESS,
|
||||
collectModuleInitData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleInitData,
|
||||
nonce + 1,
|
||||
MAX_UINT256
|
||||
);
|
||||
@@ -461,10 +485,11 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
contentURI: MOCK_URI,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: '1',
|
||||
collectModule: ZERO_ADDRESS,
|
||||
collectModuleData: collectModuleData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
collectModule: ZERO_ADDRESS,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -477,7 +502,8 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
|
||||
it('Testwallet should fail to comment with sig with unwhitelisted collect module', async function () {
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const collectModuleData = [];
|
||||
const collectModuleInitData = [];
|
||||
const referenceModuleInitData = [];
|
||||
const referenceModuleData = [];
|
||||
|
||||
const { v, r, s } = await getCommentWithSigParts(
|
||||
@@ -485,10 +511,11 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
MOCK_URI,
|
||||
FIRST_PROFILE_ID,
|
||||
'1',
|
||||
userAddress,
|
||||
collectModuleData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleData,
|
||||
userAddress,
|
||||
collectModuleInitData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleInitData,
|
||||
nonce,
|
||||
MAX_UINT256
|
||||
);
|
||||
@@ -499,10 +526,11 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
contentURI: MOCK_URI,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: '1',
|
||||
collectModule: userAddress,
|
||||
collectModuleData: collectModuleData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
collectModule: userAddress,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -519,7 +547,8 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
).to.not.be.reverted;
|
||||
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const collectModuleData = abiCoder.encode(['bool'], [true]);
|
||||
const collectModuleInitData = abiCoder.encode(['bool'], [true]);
|
||||
const referenceModuleInitData = [];
|
||||
const referenceModuleData = [];
|
||||
|
||||
const { v, r, s } = await getCommentWithSigParts(
|
||||
@@ -527,10 +556,11 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
MOCK_URI,
|
||||
FIRST_PROFILE_ID,
|
||||
'1',
|
||||
freeCollectModule.address,
|
||||
collectModuleData,
|
||||
mockReferenceModule.address,
|
||||
referenceModuleData,
|
||||
freeCollectModule.address,
|
||||
collectModuleInitData,
|
||||
mockReferenceModule.address,
|
||||
referenceModuleInitData,
|
||||
nonce,
|
||||
MAX_UINT256
|
||||
);
|
||||
@@ -541,10 +571,11 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
contentURI: MOCK_URI,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: '1',
|
||||
referenceModuleData,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: mockReferenceModule.address,
|
||||
referenceModuleData: referenceModuleData,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -561,7 +592,8 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
).to.not.be.reverted;
|
||||
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const collectModuleData = abiCoder.encode(['bool'], [true]);
|
||||
const collectModuleInitData = abiCoder.encode(['bool'], [true]);
|
||||
const referenceModuleInitData = [];
|
||||
const referenceModuleData = [];
|
||||
|
||||
const { v, r, s } = await getCommentWithSigParts(
|
||||
@@ -569,10 +601,11 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
OTHER_MOCK_URI,
|
||||
FIRST_PROFILE_ID,
|
||||
'3',
|
||||
freeCollectModule.address,
|
||||
collectModuleData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleData,
|
||||
freeCollectModule.address,
|
||||
collectModuleInitData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleInitData,
|
||||
nonce,
|
||||
MAX_UINT256
|
||||
);
|
||||
@@ -583,10 +616,11 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
contentURI: OTHER_MOCK_URI,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: '3',
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -603,18 +637,19 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
).to.not.be.reverted;
|
||||
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const collectModuleData = [];
|
||||
const collectModuleInitData = [];
|
||||
const referenceModuleInitData = [];
|
||||
const referenceModuleData = [];
|
||||
|
||||
const { v, r, s } = await getCommentWithSigParts(
|
||||
FIRST_PROFILE_ID,
|
||||
OTHER_MOCK_URI,
|
||||
FIRST_PROFILE_ID,
|
||||
'2',
|
||||
freeCollectModule.address,
|
||||
collectModuleData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleData,
|
||||
freeCollectModule.address,
|
||||
collectModuleInitData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleInitData,
|
||||
nonce,
|
||||
MAX_UINT256
|
||||
);
|
||||
@@ -625,10 +660,11 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
contentURI: OTHER_MOCK_URI,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: '2',
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -645,7 +681,8 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
).to.not.be.reverted;
|
||||
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const collectModuleData = abiCoder.encode(['bool'], [true]);
|
||||
const collectModuleInitData = abiCoder.encode(['bool'], [true]);
|
||||
const referenceModuleInitData = [];
|
||||
const referenceModuleData = [];
|
||||
|
||||
const { v, r, s } = await getCommentWithSigParts(
|
||||
@@ -653,10 +690,11 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
OTHER_MOCK_URI,
|
||||
FIRST_PROFILE_ID,
|
||||
'1',
|
||||
freeCollectModule.address,
|
||||
collectModuleData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleData,
|
||||
freeCollectModule.address,
|
||||
collectModuleInitData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleInitData,
|
||||
nonce,
|
||||
MAX_UINT256
|
||||
);
|
||||
@@ -669,10 +707,11 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
contentURI: OTHER_MOCK_URI,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: '1',
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -691,7 +730,8 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
).to.not.be.reverted;
|
||||
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const collectModuleData = abiCoder.encode(['bool'], [true]);
|
||||
const collectModuleInitData = abiCoder.encode(['bool'], [true]);
|
||||
const referenceModuleInitData = [];
|
||||
const referenceModuleData = [];
|
||||
|
||||
const { v, r, s } = await getCommentWithSigParts(
|
||||
@@ -699,10 +739,11 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
OTHER_MOCK_URI,
|
||||
FIRST_PROFILE_ID,
|
||||
'1',
|
||||
freeCollectModule.address,
|
||||
collectModuleData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleData,
|
||||
freeCollectModule.address,
|
||||
collectModuleInitData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleInitData,
|
||||
nonce,
|
||||
MAX_UINT256
|
||||
);
|
||||
@@ -713,10 +754,11 @@ makeSuiteCleanRoom('Publishing Comments', function () {
|
||||
contentURI: OTHER_MOCK_URI,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: '1',
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
|
||||
@@ -34,7 +34,7 @@ makeSuiteCleanRoom('Publishing mirrors', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -52,9 +52,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
});
|
||||
@@ -66,8 +66,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.NOT_PROFILE_OWNER_OR_DISPATCHER);
|
||||
});
|
||||
@@ -78,8 +79,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: userAddress,
|
||||
referenceModuleData: [],
|
||||
referenceModule: userAddress,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.REFERENCE_MODULE_NOT_WHITELISTED);
|
||||
});
|
||||
@@ -90,8 +92,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModuleData: [],
|
||||
referenceModule: mockReferenceModule.address,
|
||||
referenceModuleData: [0x12, 0x23],
|
||||
referenceModuleInitData: [0x12, 0x23],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.NO_REASON_ABI_DECODE);
|
||||
});
|
||||
@@ -102,8 +105,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 2,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.PUBLICATION_DOES_NOT_EXIST);
|
||||
});
|
||||
@@ -117,7 +121,7 @@ makeSuiteCleanRoom('Publishing mirrors', function () {
|
||||
handle: 'testwallet',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -127,7 +131,7 @@ makeSuiteCleanRoom('Publishing mirrors', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -138,8 +142,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
},
|
||||
})
|
||||
).to.eq(2);
|
||||
@@ -151,20 +156,24 @@ makeSuiteCleanRoom('Publishing mirrors', function () {
|
||||
profileId: FIRST_PROFILE_ID + 2,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 2,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
},
|
||||
})
|
||||
).to.eq(1);
|
||||
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const referenceModuleInitData = [];
|
||||
const referenceModuleData = [];
|
||||
|
||||
const { v, r, s } = await getMirrorWithSigParts(
|
||||
FIRST_PROFILE_ID + 1,
|
||||
FIRST_PROFILE_ID,
|
||||
'1',
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleInitData,
|
||||
nonce,
|
||||
MAX_UINT256
|
||||
);
|
||||
@@ -174,8 +183,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () {
|
||||
profileId: FIRST_PROFILE_ID + 1,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: '1',
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -192,8 +202,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID + 1,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
},
|
||||
})
|
||||
).to.eq(3);
|
||||
@@ -205,8 +216,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -225,8 +237,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -235,8 +248,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 2,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -256,9 +270,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: mockReferenceModule.address,
|
||||
referenceModuleData: data,
|
||||
referenceModuleInitData: data,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -267,8 +281,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 2,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
});
|
||||
@@ -283,7 +298,7 @@ makeSuiteCleanRoom('Publishing mirrors', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -297,9 +312,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
});
|
||||
@@ -307,14 +322,16 @@ makeSuiteCleanRoom('Publishing mirrors', function () {
|
||||
context('Negatives', function () {
|
||||
it('Testwallet should fail to mirror with sig with signature deadline mismatch', async function () {
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const referenceModuleInitData = [];
|
||||
const referenceModuleData = [];
|
||||
|
||||
const { v, r, s } = await getMirrorWithSigParts(
|
||||
FIRST_PROFILE_ID,
|
||||
FIRST_PROFILE_ID,
|
||||
'1',
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleInitData,
|
||||
nonce,
|
||||
'0'
|
||||
);
|
||||
@@ -324,8 +341,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: '1',
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -338,14 +356,16 @@ makeSuiteCleanRoom('Publishing mirrors', function () {
|
||||
|
||||
it('Testwallet should fail to mirror with sig with invalid deadline', async function () {
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const referenceModuleInitData = [];
|
||||
const referenceModuleData = [];
|
||||
|
||||
const { v, r, s } = await getMirrorWithSigParts(
|
||||
FIRST_PROFILE_ID,
|
||||
FIRST_PROFILE_ID,
|
||||
'1',
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleInitData,
|
||||
nonce,
|
||||
'0'
|
||||
);
|
||||
@@ -355,8 +375,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: '1',
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -369,14 +390,16 @@ makeSuiteCleanRoom('Publishing mirrors', function () {
|
||||
|
||||
it('Testwallet should fail to mirror with sig with invalid deadline', async function () {
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const referenceModuleInitData = [];
|
||||
const referenceModuleData = [];
|
||||
|
||||
const { v, r, s } = await getMirrorWithSigParts(
|
||||
FIRST_PROFILE_ID,
|
||||
FIRST_PROFILE_ID,
|
||||
'1',
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleInitData,
|
||||
nonce + 1,
|
||||
MAX_UINT256
|
||||
);
|
||||
@@ -386,8 +409,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: '1',
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -400,14 +424,15 @@ makeSuiteCleanRoom('Publishing mirrors', function () {
|
||||
|
||||
it('Testwallet should fail to mirror with sig with unwhitelisted reference module', async function () {
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const referenceModuleInitData = [];
|
||||
const referenceModuleData = [];
|
||||
|
||||
const { v, r, s } = await getMirrorWithSigParts(
|
||||
FIRST_PROFILE_ID,
|
||||
FIRST_PROFILE_ID,
|
||||
'1',
|
||||
userAddress,
|
||||
referenceModuleData,
|
||||
userAddress,
|
||||
referenceModuleInitData,
|
||||
nonce,
|
||||
MAX_UINT256
|
||||
);
|
||||
@@ -417,8 +442,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: '1',
|
||||
referenceModuleData: [],
|
||||
referenceModule: userAddress,
|
||||
referenceModuleData: referenceModuleData,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -431,14 +457,16 @@ makeSuiteCleanRoom('Publishing mirrors', function () {
|
||||
|
||||
it('TestWallet should fail to mirror a publication with sig that does not exist yet', async function () {
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const referenceModuleInitData = [];
|
||||
const referenceModuleData = [];
|
||||
|
||||
const { v, r, s } = await getMirrorWithSigParts(
|
||||
FIRST_PROFILE_ID,
|
||||
FIRST_PROFILE_ID,
|
||||
'2',
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleInitData,
|
||||
nonce,
|
||||
MAX_UINT256
|
||||
);
|
||||
@@ -448,8 +476,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: '2',
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -462,14 +491,16 @@ makeSuiteCleanRoom('Publishing mirrors', function () {
|
||||
|
||||
it('TestWallet should sign attempt to mirror with sig, cancel via empty permitForAll, then fail to mirror with sig', async function () {
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const referenceModuleInitData = [];
|
||||
const referenceModuleData = [];
|
||||
|
||||
const { v, r, s } = await getMirrorWithSigParts(
|
||||
FIRST_PROFILE_ID,
|
||||
FIRST_PROFILE_ID,
|
||||
'1',
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleInitData,
|
||||
nonce,
|
||||
MAX_UINT256
|
||||
);
|
||||
@@ -481,8 +512,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: '1',
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -497,14 +529,16 @@ makeSuiteCleanRoom('Publishing mirrors', function () {
|
||||
context('Scenarios', function () {
|
||||
it('Testwallet should mirror with sig, fetched mirror data should be accurate', async function () {
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const referenceModuleInitData = [];
|
||||
const referenceModuleData = [];
|
||||
|
||||
const { v, r, s } = await getMirrorWithSigParts(
|
||||
FIRST_PROFILE_ID,
|
||||
FIRST_PROFILE_ID,
|
||||
'1',
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleInitData,
|
||||
nonce,
|
||||
MAX_UINT256
|
||||
);
|
||||
@@ -514,8 +548,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: '1',
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -540,20 +575,23 @@ makeSuiteCleanRoom('Publishing mirrors', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const referenceModuleInitData = [];
|
||||
const referenceModuleData = [];
|
||||
|
||||
|
||||
const { v, r, s } = await getMirrorWithSigParts(
|
||||
FIRST_PROFILE_ID,
|
||||
FIRST_PROFILE_ID,
|
||||
'2',
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleInitData,
|
||||
nonce,
|
||||
MAX_UINT256
|
||||
);
|
||||
@@ -563,8 +601,9 @@ makeSuiteCleanRoom('Publishing mirrors', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: '2',
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
|
||||
@@ -36,7 +36,7 @@ makeSuiteCleanRoom('Publishing Posts', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -49,9 +49,9 @@ makeSuiteCleanRoom('Publishing Posts', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.NOT_PROFILE_OWNER_OR_DISPATCHER);
|
||||
});
|
||||
@@ -62,9 +62,9 @@ makeSuiteCleanRoom('Publishing Posts', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.COLLECT_MODULE_NOT_WHITELISTED);
|
||||
});
|
||||
@@ -79,9 +79,9 @@ makeSuiteCleanRoom('Publishing Posts', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: userAddress,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.REFERENCE_MODULE_NOT_WHITELISTED);
|
||||
});
|
||||
@@ -96,9 +96,9 @@ makeSuiteCleanRoom('Publishing Posts', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: timedFeeCollectModule.address,
|
||||
collectModuleData: [0x12, 0x34],
|
||||
collectModuleInitData: [0x12, 0x34],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.NO_REASON_ABI_DECODE);
|
||||
});
|
||||
@@ -117,9 +117,9 @@ makeSuiteCleanRoom('Publishing Posts', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: mockReferenceModule.address,
|
||||
referenceModuleData: [0x12, 0x23],
|
||||
referenceModuleInitData: [0x12, 0x23],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.NO_REASON_ABI_DECODE);
|
||||
});
|
||||
@@ -137,7 +137,7 @@ makeSuiteCleanRoom('Publishing Posts', function () {
|
||||
handle: 'testwallet',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -147,7 +147,7 @@ makeSuiteCleanRoom('Publishing Posts', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -158,9 +158,9 @@ makeSuiteCleanRoom('Publishing Posts', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
},
|
||||
})
|
||||
).to.eq(1);
|
||||
@@ -172,23 +172,24 @@ makeSuiteCleanRoom('Publishing Posts', function () {
|
||||
profileId: FIRST_PROFILE_ID + 2,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
},
|
||||
})
|
||||
).to.eq(1);
|
||||
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const collectModuleData = abiCoder.encode(['bool'], [true]);
|
||||
const collectModuleInitData = abiCoder.encode(['bool'], [true]);
|
||||
const referenceModuleInitData = [];
|
||||
const referenceModuleData = [];
|
||||
const { v, r, s } = await getPostWithSigParts(
|
||||
FIRST_PROFILE_ID + 1,
|
||||
MOCK_URI,
|
||||
freeCollectModule.address,
|
||||
collectModuleData,
|
||||
collectModuleInitData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleData,
|
||||
referenceModuleInitData,
|
||||
nonce,
|
||||
MAX_UINT256
|
||||
);
|
||||
@@ -198,9 +199,9 @@ makeSuiteCleanRoom('Publishing Posts', function () {
|
||||
profileId: FIRST_PROFILE_ID + 1,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -217,9 +218,9 @@ makeSuiteCleanRoom('Publishing Posts', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
},
|
||||
})
|
||||
).to.eq(2);
|
||||
@@ -235,9 +236,9 @@ makeSuiteCleanRoom('Publishing Posts', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -263,9 +264,9 @@ makeSuiteCleanRoom('Publishing Posts', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: mockReferenceModule.address,
|
||||
referenceModuleData: mockModuleData,
|
||||
referenceModuleInitData: mockModuleData,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
});
|
||||
@@ -280,7 +281,7 @@ makeSuiteCleanRoom('Publishing Posts', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -293,16 +294,16 @@ makeSuiteCleanRoom('Publishing Posts', function () {
|
||||
).to.not.be.reverted;
|
||||
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const collectModuleData = [];
|
||||
const collectModuleInitData = [];
|
||||
const referenceModuleInitData = [];
|
||||
const referenceModuleData = [];
|
||||
|
||||
const { v, r, s } = await getPostWithSigParts(
|
||||
FIRST_PROFILE_ID,
|
||||
MOCK_URI,
|
||||
ZERO_ADDRESS,
|
||||
collectModuleData,
|
||||
collectModuleInitData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleData,
|
||||
referenceModuleInitData,
|
||||
nonce,
|
||||
'0'
|
||||
);
|
||||
@@ -312,9 +313,9 @@ makeSuiteCleanRoom('Publishing Posts', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: ZERO_ADDRESS,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -331,16 +332,16 @@ makeSuiteCleanRoom('Publishing Posts', function () {
|
||||
).to.not.be.reverted;
|
||||
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const collectModuleData = [];
|
||||
const collectModuleInitData = [];
|
||||
const referenceModuleInitData = [];
|
||||
const referenceModuleData = [];
|
||||
|
||||
const { v, r, s } = await getPostWithSigParts(
|
||||
FIRST_PROFILE_ID,
|
||||
MOCK_URI,
|
||||
ZERO_ADDRESS,
|
||||
collectModuleData,
|
||||
collectModuleInitData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleData,
|
||||
referenceModuleInitData,
|
||||
nonce,
|
||||
'0'
|
||||
);
|
||||
@@ -350,9 +351,9 @@ makeSuiteCleanRoom('Publishing Posts', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: ZERO_ADDRESS,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -369,16 +370,16 @@ makeSuiteCleanRoom('Publishing Posts', function () {
|
||||
).to.not.be.reverted;
|
||||
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const collectModuleData = [];
|
||||
const collectModuleInitData = [];
|
||||
const referenceModuleInitData = [];
|
||||
const referenceModuleData = [];
|
||||
|
||||
const { v, r, s } = await getPostWithSigParts(
|
||||
FIRST_PROFILE_ID,
|
||||
MOCK_URI,
|
||||
ZERO_ADDRESS,
|
||||
collectModuleData,
|
||||
collectModuleInitData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleData,
|
||||
referenceModuleInitData,
|
||||
nonce + 1,
|
||||
MAX_UINT256
|
||||
);
|
||||
@@ -388,9 +389,9 @@ makeSuiteCleanRoom('Publishing Posts', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: ZERO_ADDRESS,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -403,16 +404,16 @@ makeSuiteCleanRoom('Publishing Posts', function () {
|
||||
|
||||
it('Testwallet should fail to post with sig with an unwhitelisted collect module', async function () {
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const collectModuleData = [];
|
||||
const collectModuleInitData = [];
|
||||
const referenceModuleInitData = [];
|
||||
const referenceModuleData = [];
|
||||
|
||||
const { v, r, s } = await getPostWithSigParts(
|
||||
FIRST_PROFILE_ID,
|
||||
MOCK_URI,
|
||||
userAddress,
|
||||
collectModuleData,
|
||||
collectModuleInitData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleData,
|
||||
referenceModuleInitData,
|
||||
nonce,
|
||||
MAX_UINT256
|
||||
);
|
||||
@@ -422,9 +423,9 @@ makeSuiteCleanRoom('Publishing Posts', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: userAddress,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -441,16 +442,16 @@ makeSuiteCleanRoom('Publishing Posts', function () {
|
||||
).to.not.be.reverted;
|
||||
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const collectModuleData = abiCoder.encode(['bool'], [true]);
|
||||
const collectModuleInitData = abiCoder.encode(['bool'], [true]);
|
||||
const referenceModuleInitData = [];
|
||||
const referenceModuleData = [];
|
||||
|
||||
const { v, r, s } = await getPostWithSigParts(
|
||||
FIRST_PROFILE_ID,
|
||||
MOCK_URI,
|
||||
freeCollectModule.address,
|
||||
collectModuleData,
|
||||
collectModuleInitData,
|
||||
userAddress,
|
||||
referenceModuleData,
|
||||
referenceModuleInitData,
|
||||
nonce,
|
||||
MAX_UINT256
|
||||
);
|
||||
@@ -460,9 +461,9 @@ makeSuiteCleanRoom('Publishing Posts', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: userAddress,
|
||||
referenceModuleData: referenceModuleData,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -479,16 +480,16 @@ makeSuiteCleanRoom('Publishing Posts', function () {
|
||||
).to.not.be.reverted;
|
||||
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const collectModuleData = abiCoder.encode(['bool'], [true]);
|
||||
const collectModuleInitData = abiCoder.encode(['bool'], [true]);
|
||||
const referenceModuleInitData = [];
|
||||
const referenceModuleData = [];
|
||||
|
||||
const { v, r, s } = await getPostWithSigParts(
|
||||
FIRST_PROFILE_ID,
|
||||
MOCK_URI,
|
||||
freeCollectModule.address,
|
||||
collectModuleData,
|
||||
collectModuleInitData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleData,
|
||||
referenceModuleInitData,
|
||||
nonce,
|
||||
MAX_UINT256
|
||||
);
|
||||
@@ -500,9 +501,9 @@ makeSuiteCleanRoom('Publishing Posts', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -521,16 +522,16 @@ makeSuiteCleanRoom('Publishing Posts', function () {
|
||||
).to.not.be.reverted;
|
||||
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const collectModuleData = abiCoder.encode(['bool'], [true]);
|
||||
const collectModuleInitData = abiCoder.encode(['bool'], [true]);
|
||||
const referenceModuleInitData = [];
|
||||
const referenceModuleData = [];
|
||||
|
||||
const { v, r, s } = await getPostWithSigParts(
|
||||
FIRST_PROFILE_ID,
|
||||
MOCK_URI,
|
||||
freeCollectModule.address,
|
||||
collectModuleData,
|
||||
collectModuleInitData,
|
||||
ZERO_ADDRESS,
|
||||
referenceModuleData,
|
||||
referenceModuleInitData,
|
||||
nonce,
|
||||
MAX_UINT256
|
||||
);
|
||||
@@ -540,9 +541,9 @@ makeSuiteCleanRoom('Publishing Posts', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: referenceModuleData,
|
||||
referenceModuleInitData: referenceModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
|
||||
@@ -25,7 +25,7 @@ makeSuiteCleanRoom('Default profile Functionality', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -63,7 +63,7 @@ makeSuiteCleanRoom('Default profile Functionality', function () {
|
||||
handle: new Date().getTime().toString(),
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -92,7 +92,7 @@ makeSuiteCleanRoom('Default profile Functionality', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -318,7 +318,7 @@ makeSuiteCleanRoom('Default profile Functionality', function () {
|
||||
handle: new Date().getTime().toString(),
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -29,7 +29,7 @@ makeSuiteCleanRoom('Dispatcher Functionality', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -51,9 +51,9 @@ makeSuiteCleanRoom('Dispatcher Functionality', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.NOT_PROFILE_OWNER_OR_DISPATCHER);
|
||||
});
|
||||
@@ -75,9 +75,9 @@ makeSuiteCleanRoom('Dispatcher Functionality', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -88,9 +88,10 @@ makeSuiteCleanRoom('Dispatcher Functionality', function () {
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -99,8 +100,9 @@ makeSuiteCleanRoom('Dispatcher Functionality', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
});
|
||||
@@ -115,7 +117,7 @@ makeSuiteCleanRoom('Dispatcher Functionality', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -248,9 +250,9 @@ makeSuiteCleanRoom('Dispatcher Functionality', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -261,9 +263,10 @@ makeSuiteCleanRoom('Dispatcher Functionality', function () {
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -272,8 +275,9 @@ makeSuiteCleanRoom('Dispatcher Functionality', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
});
|
||||
|
||||
@@ -32,7 +32,7 @@ makeSuiteCleanRoom('Profile Creation', function () {
|
||||
handle: val,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.INVALID_HANDLE_LENGTH);
|
||||
@@ -45,7 +45,7 @@ makeSuiteCleanRoom('Profile Creation', function () {
|
||||
handle: '',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.INVALID_HANDLE_LENGTH);
|
||||
@@ -58,7 +58,7 @@ makeSuiteCleanRoom('Profile Creation', function () {
|
||||
handle: 'Egg',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.HANDLE_CONTAINS_INVALID_CHARACTERS);
|
||||
@@ -71,7 +71,7 @@ makeSuiteCleanRoom('Profile Creation', function () {
|
||||
handle: 'egg?',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.HANDLE_CONTAINS_INVALID_CHARACTERS);
|
||||
@@ -84,7 +84,7 @@ makeSuiteCleanRoom('Profile Creation', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: userAddress,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.FOLLOW_MODULE_NOT_WHITELISTED);
|
||||
@@ -101,7 +101,7 @@ makeSuiteCleanRoom('Profile Creation', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: mockFollowModule.address,
|
||||
followModuleData: [0x12, 0x34],
|
||||
followModuleInitData: [0x12, 0x34],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.NO_REASON_ABI_DECODE);
|
||||
@@ -118,7 +118,7 @@ makeSuiteCleanRoom('Profile Creation', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.PROFILE_CREATOR_NOT_WHITELISTED);
|
||||
@@ -141,7 +141,7 @@ makeSuiteCleanRoom('Profile Creation', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
},
|
||||
})
|
||||
@@ -170,7 +170,7 @@ makeSuiteCleanRoom('Profile Creation', function () {
|
||||
handle: secondProfileHandle,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
},
|
||||
})
|
||||
@@ -198,7 +198,7 @@ makeSuiteCleanRoom('Profile Creation', function () {
|
||||
handle: 'token.id_1',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
},
|
||||
})
|
||||
@@ -213,7 +213,7 @@ makeSuiteCleanRoom('Profile Creation', function () {
|
||||
handle: 'token.id_2',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
},
|
||||
})
|
||||
@@ -227,7 +227,7 @@ makeSuiteCleanRoom('Profile Creation', function () {
|
||||
handle: 'token.id_3',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
},
|
||||
})
|
||||
@@ -241,7 +241,7 @@ makeSuiteCleanRoom('Profile Creation', function () {
|
||||
handle: 'morse--__-_--code',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -254,7 +254,7 @@ makeSuiteCleanRoom('Profile Creation', function () {
|
||||
handle: '123456789012345',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -264,7 +264,7 @@ makeSuiteCleanRoom('Profile Creation', function () {
|
||||
handle: '123456789012345',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.PROFILE_HANDLE_TAKEN);
|
||||
@@ -274,7 +274,7 @@ makeSuiteCleanRoom('Profile Creation', function () {
|
||||
handle: 'abcdefghijklmno',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -291,7 +291,7 @@ makeSuiteCleanRoom('Profile Creation', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: mockFollowModule.address,
|
||||
followModuleData: mockModuleData,
|
||||
followModuleInitData: mockModuleData,
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -304,7 +304,7 @@ makeSuiteCleanRoom('Profile Creation', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -38,7 +38,7 @@ makeSuiteCleanRoom('Profile URI Functionality', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -240,7 +240,7 @@ makeSuiteCleanRoom('Profile URI Functionality', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -27,7 +27,7 @@ makeSuiteCleanRoom('Setting Follow Module', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -84,7 +84,7 @@ makeSuiteCleanRoom('Setting Follow Module', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -97,12 +97,12 @@ makeSuiteCleanRoom('Setting Follow Module', function () {
|
||||
).to.not.be.reverted;
|
||||
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const followModuleData = [];
|
||||
const followModuleInitData = [];
|
||||
|
||||
const { v, r, s } = await getSetFollowModuleWithSigParts(
|
||||
FIRST_PROFILE_ID,
|
||||
mockFollowModule.address,
|
||||
followModuleData,
|
||||
followModuleInitData,
|
||||
nonce,
|
||||
'0'
|
||||
);
|
||||
@@ -111,7 +111,7 @@ makeSuiteCleanRoom('Setting Follow Module', function () {
|
||||
lensHub.setFollowModuleWithSig({
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
followModule: mockFollowModule.address,
|
||||
followModuleData: followModuleData,
|
||||
followModuleInitData: followModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -128,12 +128,12 @@ makeSuiteCleanRoom('Setting Follow Module', function () {
|
||||
).to.not.be.reverted;
|
||||
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const followModuleData = [];
|
||||
const followModuleInitData = [];
|
||||
|
||||
const { v, r, s } = await getSetFollowModuleWithSigParts(
|
||||
FIRST_PROFILE_ID,
|
||||
mockFollowModule.address,
|
||||
followModuleData,
|
||||
followModuleInitData,
|
||||
nonce,
|
||||
'0'
|
||||
);
|
||||
@@ -142,7 +142,7 @@ makeSuiteCleanRoom('Setting Follow Module', function () {
|
||||
lensHub.setFollowModuleWithSig({
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
followModule: mockFollowModule.address,
|
||||
followModuleData: followModuleData,
|
||||
followModuleInitData: followModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -159,12 +159,12 @@ makeSuiteCleanRoom('Setting Follow Module', function () {
|
||||
).to.not.be.reverted;
|
||||
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const followModuleData = [];
|
||||
const followModuleInitData = [];
|
||||
|
||||
const { v, r, s } = await getSetFollowModuleWithSigParts(
|
||||
FIRST_PROFILE_ID,
|
||||
mockFollowModule.address,
|
||||
followModuleData,
|
||||
followModuleInitData,
|
||||
nonce + 1,
|
||||
MAX_UINT256
|
||||
);
|
||||
@@ -173,7 +173,7 @@ makeSuiteCleanRoom('Setting Follow Module', function () {
|
||||
lensHub.setFollowModuleWithSig({
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
followModule: mockFollowModule.address,
|
||||
followModuleData: followModuleData,
|
||||
followModuleInitData: followModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -186,12 +186,12 @@ makeSuiteCleanRoom('Setting Follow Module', function () {
|
||||
|
||||
it('TestWallet should fail to set a follow module with sig with an unwhitelisted follow module', async function () {
|
||||
const nonce = (await lensHub.sigNonces(testWallet.address)).toNumber();
|
||||
const followModuleData = [];
|
||||
const followModuleInitData = [];
|
||||
|
||||
const { v, r, s } = await getSetFollowModuleWithSigParts(
|
||||
FIRST_PROFILE_ID,
|
||||
mockFollowModule.address,
|
||||
followModuleData,
|
||||
followModuleInitData,
|
||||
nonce,
|
||||
MAX_UINT256
|
||||
);
|
||||
@@ -200,7 +200,7 @@ makeSuiteCleanRoom('Setting Follow Module', function () {
|
||||
lensHub.setFollowModuleWithSig({
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
followModule: mockFollowModule.address,
|
||||
followModuleData: followModuleData,
|
||||
followModuleInitData: followModuleInitData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -232,7 +232,7 @@ makeSuiteCleanRoom('Setting Follow Module', function () {
|
||||
lensHub.setFollowModuleWithSig({
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
followModule: mockFollowModule.address,
|
||||
followModuleData: mockModuleData,
|
||||
followModuleInitData: mockModuleData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
@@ -264,7 +264,7 @@ makeSuiteCleanRoom('Setting Follow Module', function () {
|
||||
lensHub.setFollowModuleWithSig({
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
followModule: mockFollowModule.address,
|
||||
followModuleData: mockModuleData,
|
||||
followModuleInitData: mockModuleData,
|
||||
sig: {
|
||||
v,
|
||||
r,
|
||||
|
||||
@@ -40,7 +40,7 @@ makeSuiteCleanRoom('Fee Collect Module', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -55,7 +55,7 @@ makeSuiteCleanRoom('Fee Collect Module', function () {
|
||||
context('Negatives', function () {
|
||||
context('Publication Creation', function () {
|
||||
it('user should fail to post with fee collect module using unwhitelisted currency', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[DEFAULT_COLLECT_PRICE, userTwoAddress, userAddress, REFERRAL_FEE_BPS, true]
|
||||
);
|
||||
@@ -64,15 +64,15 @@ makeSuiteCleanRoom('Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: feeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID);
|
||||
});
|
||||
|
||||
it('user should fail to post with fee collect module using zero recipient', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[DEFAULT_COLLECT_PRICE, currency.address, ZERO_ADDRESS, REFERRAL_FEE_BPS, true]
|
||||
);
|
||||
@@ -81,15 +81,15 @@ makeSuiteCleanRoom('Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: feeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID);
|
||||
});
|
||||
|
||||
it('user should fail to post with fee collect module using referral fee greater than max BPS', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[DEFAULT_COLLECT_PRICE, currency.address, userAddress, 10001, true]
|
||||
);
|
||||
@@ -98,15 +98,15 @@ makeSuiteCleanRoom('Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: feeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID);
|
||||
});
|
||||
|
||||
it('user should fail to post with fee collect module using zero amount', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[0, currency.address, userAddress, REFERRAL_FEE_BPS, true]
|
||||
);
|
||||
@@ -115,9 +115,9 @@ makeSuiteCleanRoom('Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: feeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID);
|
||||
});
|
||||
@@ -125,7 +125,7 @@ makeSuiteCleanRoom('Fee Collect Module', function () {
|
||||
|
||||
context('Collecting', function () {
|
||||
beforeEach(async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[DEFAULT_COLLECT_PRICE, currency.address, userAddress, REFERRAL_FEE_BPS, true]
|
||||
);
|
||||
@@ -134,9 +134,9 @@ makeSuiteCleanRoom('Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: feeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
});
|
||||
@@ -189,7 +189,7 @@ makeSuiteCleanRoom('Fee Collect Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -198,8 +198,9 @@ makeSuiteCleanRoom('Fee Collect Module', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -301,7 +302,7 @@ makeSuiteCleanRoom('Fee Collect Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -310,8 +311,9 @@ makeSuiteCleanRoom('Fee Collect Module', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -329,7 +331,7 @@ makeSuiteCleanRoom('Fee Collect Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -338,8 +340,9 @@ makeSuiteCleanRoom('Fee Collect Module', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -362,7 +365,7 @@ makeSuiteCleanRoom('Fee Collect Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -371,8 +374,9 @@ makeSuiteCleanRoom('Fee Collect Module', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -388,7 +392,7 @@ makeSuiteCleanRoom('Fee Collect Module', function () {
|
||||
|
||||
context('Scenarios', function () {
|
||||
it('User should post with fee collect module as the collect module and data, correct events should be emitted', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[DEFAULT_COLLECT_PRICE, currency.address, userAddress, REFERRAL_FEE_BPS, true]
|
||||
);
|
||||
@@ -396,9 +400,9 @@ makeSuiteCleanRoom('Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: feeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
});
|
||||
|
||||
const receipt = await waitForTx(tx);
|
||||
@@ -409,7 +413,7 @@ makeSuiteCleanRoom('Fee Collect Module', function () {
|
||||
1,
|
||||
MOCK_URI,
|
||||
feeCollectModule.address,
|
||||
[collectModuleData],
|
||||
[collectModuleInitData],
|
||||
ZERO_ADDRESS,
|
||||
[],
|
||||
await getTimestamp(),
|
||||
@@ -417,7 +421,7 @@ makeSuiteCleanRoom('Fee Collect Module', function () {
|
||||
});
|
||||
|
||||
it('User should post with the fee collect module as the collect module and data, fetched publication data should be accurate', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[DEFAULT_COLLECT_PRICE, currency.address, userAddress, REFERRAL_FEE_BPS, true]
|
||||
);
|
||||
@@ -426,9 +430,9 @@ makeSuiteCleanRoom('Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: feeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
const postTimestamp = await getTimestamp();
|
||||
@@ -442,7 +446,7 @@ makeSuiteCleanRoom('Fee Collect Module', function () {
|
||||
});
|
||||
|
||||
it('User should post with the fee collect module as the collect module and data, allowing non-followers to collect, user two collects without following, fee distribution is valid', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[DEFAULT_COLLECT_PRICE, currency.address, userAddress, REFERRAL_FEE_BPS, false]
|
||||
);
|
||||
@@ -451,9 +455,9 @@ makeSuiteCleanRoom('Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: feeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -481,7 +485,7 @@ makeSuiteCleanRoom('Fee Collect Module', function () {
|
||||
});
|
||||
|
||||
it('User should post with the fee collect module as the collect module and data, user two follows, then collects and pays fee, fee distribution is valid', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[DEFAULT_COLLECT_PRICE, currency.address, userAddress, REFERRAL_FEE_BPS, true]
|
||||
);
|
||||
@@ -490,9 +494,9 @@ makeSuiteCleanRoom('Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: feeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -521,7 +525,7 @@ makeSuiteCleanRoom('Fee Collect Module', function () {
|
||||
});
|
||||
|
||||
it('User should post with the fee collect module as the collect module and data, user two follows, then collects twice, fee distribution is valid', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[DEFAULT_COLLECT_PRICE, currency.address, userAddress, REFERRAL_FEE_BPS, true]
|
||||
);
|
||||
@@ -530,9 +534,9 @@ makeSuiteCleanRoom('Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: feeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -563,18 +567,19 @@ makeSuiteCleanRoom('Fee Collect Module', function () {
|
||||
|
||||
it('User should post with the fee collect module as the collect module and data, user two mirrors, follows, then collects from their mirror and pays fee, fee distribution is valid', async function () {
|
||||
const secondProfileId = FIRST_PROFILE_ID + 1;
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[DEFAULT_COLLECT_PRICE, currency.address, userAddress, REFERRAL_FEE_BPS, true]
|
||||
);
|
||||
|
||||
await expect(
|
||||
lensHub.post({
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: feeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -584,7 +589,7 @@ makeSuiteCleanRoom('Fee Collect Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -593,8 +598,9 @@ makeSuiteCleanRoom('Fee Collect Module', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -630,18 +636,19 @@ makeSuiteCleanRoom('Fee Collect Module', function () {
|
||||
|
||||
it('User should post with the fee collect module as the collect module and data, with no referral fee, user two mirrors, follows, then collects from their mirror and pays fee, fee distribution is valid', async function () {
|
||||
const secondProfileId = FIRST_PROFILE_ID + 1;
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[DEFAULT_COLLECT_PRICE, currency.address, userAddress, 0, true]
|
||||
);
|
||||
|
||||
await expect(
|
||||
lensHub.post({
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: feeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -651,7 +658,7 @@ makeSuiteCleanRoom('Fee Collect Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -660,8 +667,9 @@ makeSuiteCleanRoom('Fee Collect Module', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ makeSuiteCleanRoom('Free Collect Module', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -45,9 +45,9 @@ makeSuiteCleanRoom('Free Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
await expect(lensHub.connect(userTwo).collect(FIRST_PROFILE_ID, 1, [])).to.be.revertedWith(
|
||||
@@ -61,9 +61,9 @@ makeSuiteCleanRoom('Free Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
const secondProfileId = FIRST_PROFILE_ID + 1;
|
||||
@@ -73,7 +73,7 @@ makeSuiteCleanRoom('Free Collect Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -82,8 +82,9 @@ makeSuiteCleanRoom('Free Collect Module', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -101,9 +102,9 @@ makeSuiteCleanRoom('Free Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [false]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [false]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
await expect(lensHub.connect(userTwo).collect(FIRST_PROFILE_ID, 1, [])).to.not.be.reverted;
|
||||
@@ -115,9 +116,9 @@ makeSuiteCleanRoom('Free Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
await expect(lensHub.connect(userTwo).follow([FIRST_PROFILE_ID], [[]])).to.not.be.reverted;
|
||||
@@ -130,9 +131,9 @@ makeSuiteCleanRoom('Free Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
await expect(
|
||||
@@ -154,9 +155,9 @@ makeSuiteCleanRoom('Free Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
const secondProfileId = FIRST_PROFILE_ID + 1;
|
||||
@@ -167,7 +168,7 @@ makeSuiteCleanRoom('Free Collect Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -176,8 +177,9 @@ makeSuiteCleanRoom('Free Collect Module', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -53,7 +53,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
context('Negatives', function () {
|
||||
context('Publication Creation', function () {
|
||||
it('user should fail to post with limited fee collect module using zero collect limit', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[0, DEFAULT_COLLECT_PRICE, currency.address, userAddress, REFERRAL_FEE_BPS, true]
|
||||
);
|
||||
@@ -62,15 +62,15 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: limitedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID);
|
||||
});
|
||||
|
||||
it('user should fail to post with limited fee collect module using unwhitelisted currency', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[
|
||||
DEFAULT_COLLECT_LIMIT,
|
||||
@@ -86,15 +86,15 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: limitedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID);
|
||||
});
|
||||
|
||||
it('user should fail to post with limited fee collect module using zero recipient', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[
|
||||
DEFAULT_COLLECT_LIMIT,
|
||||
@@ -110,15 +110,15 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: limitedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID);
|
||||
});
|
||||
|
||||
it('user should fail to post with limited fee collect module using referral fee greater than max BPS', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[DEFAULT_COLLECT_LIMIT, DEFAULT_COLLECT_PRICE, currency.address, userAddress, 10001, true]
|
||||
);
|
||||
@@ -127,15 +127,15 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: limitedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID);
|
||||
});
|
||||
|
||||
it('user should fail to post with limited fee collect module using zero amount', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[DEFAULT_COLLECT_LIMIT, 0, currency.address, userAddress, REFERRAL_FEE_BPS, true]
|
||||
);
|
||||
@@ -144,9 +144,9 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: limitedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID);
|
||||
});
|
||||
@@ -154,7 +154,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
|
||||
context('Collecting', function () {
|
||||
beforeEach(async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[
|
||||
DEFAULT_COLLECT_LIMIT,
|
||||
@@ -170,9 +170,9 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: limitedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
});
|
||||
@@ -225,7 +225,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -234,8 +234,9 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -337,7 +338,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -346,8 +347,9 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -368,7 +370,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -377,8 +379,9 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -400,7 +403,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -409,8 +412,9 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -425,7 +429,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
|
||||
context('Scenarios', function () {
|
||||
it('User should post with limited fee collect module as the collect module and data, correct events should be emitted', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[
|
||||
DEFAULT_COLLECT_LIMIT,
|
||||
@@ -440,9 +444,9 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: limitedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
});
|
||||
|
||||
const receipt = await waitForTx(tx);
|
||||
@@ -453,7 +457,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
1,
|
||||
MOCK_URI,
|
||||
limitedFeeCollectModule.address,
|
||||
collectModuleData,
|
||||
collectModuleInitData,
|
||||
ZERO_ADDRESS,
|
||||
[],
|
||||
await getTimestamp(),
|
||||
@@ -461,7 +465,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
});
|
||||
|
||||
it('User should post with limited fee collect module as the collect module and data, fetched publication data should be accurate', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[
|
||||
DEFAULT_COLLECT_LIMIT,
|
||||
@@ -477,9 +481,9 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: limitedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -493,7 +497,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
});
|
||||
|
||||
it('User should post with limited fee collect module as the collect module and data, allowing non-followers to collect, user two collects without following and pays fee, fee distribution is valid', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[
|
||||
DEFAULT_COLLECT_LIMIT,
|
||||
@@ -509,9 +513,9 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: limitedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -539,7 +543,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
});
|
||||
|
||||
it('User should post with limited fee collect module as the collect module and data, user two follows, then collects and pays fee, fee distribution is valid', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[
|
||||
DEFAULT_COLLECT_LIMIT,
|
||||
@@ -555,9 +559,9 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: limitedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -586,7 +590,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
});
|
||||
|
||||
it('User should post with limited fee collect module as the collect module and data, user two follows, then collects twice, fee distribution is valid', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[
|
||||
DEFAULT_COLLECT_LIMIT,
|
||||
@@ -602,9 +606,9 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: limitedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -635,7 +639,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
|
||||
it('User should post with limited fee collect module as the collect module and data, user two mirrors, follows, then collects from their mirror and pays fee, fee distribution is valid', async function () {
|
||||
const secondProfileId = FIRST_PROFILE_ID + 1;
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[
|
||||
DEFAULT_COLLECT_LIMIT,
|
||||
@@ -651,9 +655,9 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: limitedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -663,7 +667,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -672,8 +676,9 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -709,7 +714,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
|
||||
it('User should post with limited fee collect module as the collect module and data, with no referral fee, user two mirrors, follows, then collects from their mirror and pays fee, fee distribution is valid', async function () {
|
||||
const secondProfileId = FIRST_PROFILE_ID + 1;
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[DEFAULT_COLLECT_LIMIT, DEFAULT_COLLECT_PRICE, currency.address, userAddress, 0, true]
|
||||
);
|
||||
@@ -718,9 +723,9 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: limitedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -730,7 +735,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -739,8 +744,9 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -770,7 +776,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
|
||||
it('User should post with limited fee collect module as the collect module and data, user two mirrors, follows, then collects once from the original, twice from the mirror, and fails to collect a third time from either the mirror or the original', async function () {
|
||||
const secondProfileId = FIRST_PROFILE_ID + 1;
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[
|
||||
DEFAULT_COLLECT_LIMIT,
|
||||
@@ -786,9 +792,9 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: limitedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -798,7 +804,7 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -807,8 +813,9 @@ makeSuiteCleanRoom('Limited Fee Collect Module', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -53,7 +53,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
context('Negatives', function () {
|
||||
context('Publication Creation', function () {
|
||||
it('user should fail to post with limited timed fee collect module using zero collect limit', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[0, DEFAULT_COLLECT_PRICE, currency.address, userAddress, REFERRAL_FEE_BPS, true]
|
||||
);
|
||||
@@ -62,15 +62,15 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: limitedTimedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID);
|
||||
});
|
||||
|
||||
it('user should fail to post with limited timed fee collect module using unwhitelisted currency', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[
|
||||
DEFAULT_COLLECT_LIMIT,
|
||||
@@ -86,15 +86,15 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: limitedTimedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID);
|
||||
});
|
||||
|
||||
it('user should fail to post with limited timed fee collect module using zero recipient', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[
|
||||
DEFAULT_COLLECT_LIMIT,
|
||||
@@ -110,15 +110,15 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: limitedTimedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID);
|
||||
});
|
||||
|
||||
it('user should fail to post with limited timed fee collect module using referral fee greater than max BPS', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[DEFAULT_COLLECT_LIMIT, DEFAULT_COLLECT_PRICE, currency.address, userAddress, 10001, true]
|
||||
);
|
||||
@@ -127,15 +127,15 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: limitedTimedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID);
|
||||
});
|
||||
|
||||
it('user should fail to post with limited timed fee collect module using zero amount', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[DEFAULT_COLLECT_LIMIT, 0, currency.address, userAddress, REFERRAL_FEE_BPS, true]
|
||||
);
|
||||
@@ -144,9 +144,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: limitedTimedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID);
|
||||
});
|
||||
@@ -154,7 +154,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
|
||||
context('Collecting', function () {
|
||||
beforeEach(async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[
|
||||
DEFAULT_COLLECT_LIMIT,
|
||||
@@ -170,9 +170,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: limitedTimedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
});
|
||||
@@ -225,7 +225,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -234,8 +234,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -352,7 +353,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -361,8 +362,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -383,7 +385,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -392,8 +394,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -419,7 +422,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -428,8 +431,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -452,7 +456,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -461,8 +465,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -478,7 +483,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
|
||||
context('Scenarios', function () {
|
||||
it('User should post with limited timed fee collect module as the collect module and data, correct events should be emitted', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[
|
||||
DEFAULT_COLLECT_LIMIT,
|
||||
@@ -493,9 +498,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: limitedTimedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
});
|
||||
|
||||
const receipt = await waitForTx(tx);
|
||||
@@ -529,7 +534,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
});
|
||||
|
||||
it('User should post with limited timed fee collect module as the collect module and data, fetched publication data should be accurate', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[
|
||||
DEFAULT_COLLECT_LIMIT,
|
||||
@@ -545,9 +550,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: limitedTimedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
const postTimestamp = await getTimestamp();
|
||||
@@ -566,7 +571,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
});
|
||||
|
||||
it('User should post with limited timed fee collect module as the collect module and data, allowing non-followers to collect, user two collects without following, fee distribution is valid', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[
|
||||
DEFAULT_COLLECT_LIMIT,
|
||||
@@ -582,9 +587,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: limitedTimedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -612,7 +617,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
});
|
||||
|
||||
it('User should post with limited timed fee collect module as the collect module and data, user two follows, then collects and pays fee, fee distribution is valid', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[
|
||||
DEFAULT_COLLECT_LIMIT,
|
||||
@@ -628,9 +633,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: limitedTimedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -659,7 +664,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
});
|
||||
|
||||
it('User should post with limited timed fee collect module as the collect module and data, user two follows, then collects twice, fee distribution is valid', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[
|
||||
DEFAULT_COLLECT_LIMIT,
|
||||
@@ -675,9 +680,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: limitedTimedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -708,7 +713,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
|
||||
it('User should post with limited timed fee collect module as the collect module and data, user two mirrors, follows, then collects from their mirror and pays fee, fee distribution is valid', async function () {
|
||||
const secondProfileId = FIRST_PROFILE_ID + 1;
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[
|
||||
DEFAULT_COLLECT_LIMIT,
|
||||
@@ -724,9 +729,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: limitedTimedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -736,7 +741,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -745,8 +750,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -782,7 +788,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
|
||||
it('User should post with limited timed fee collect module as the collect module and data, with no referral fee, user two mirrors, follows, then collects from their mirror and pays fee, fee distribution is valid', async function () {
|
||||
const secondProfileId = FIRST_PROFILE_ID + 1;
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[DEFAULT_COLLECT_LIMIT, DEFAULT_COLLECT_PRICE, currency.address, userAddress, 0, true]
|
||||
);
|
||||
@@ -791,9 +797,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: limitedTimedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -803,7 +809,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -812,8 +818,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -843,7 +850,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
|
||||
it('User should post with limited timed fee collect module as the collect module and data, user two mirrors, follows, then collects once from the original, twice from the mirror, and fails to collect a third time from either the mirror or the original', async function () {
|
||||
const secondProfileId = FIRST_PROFILE_ID + 1;
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[
|
||||
DEFAULT_COLLECT_LIMIT,
|
||||
@@ -859,9 +866,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: limitedTimedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -871,7 +878,7 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -880,8 +887,9 @@ makeSuiteCleanRoom('Limited Timed Fee Collect Module', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ makeSuiteCleanRoom('Revert Collect Module', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -37,9 +37,9 @@ makeSuiteCleanRoom('Revert Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: revertCollectModule.address,
|
||||
collectModuleData: [],
|
||||
collectModuleInitData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
});
|
||||
@@ -59,7 +59,7 @@ makeSuiteCleanRoom('Revert Collect Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -68,8 +68,9 @@ makeSuiteCleanRoom('Revert Collect Module', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -93,7 +94,7 @@ makeSuiteCleanRoom('Revert Collect Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -102,8 +103,9 @@ makeSuiteCleanRoom('Revert Collect Module', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -52,7 +52,7 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
context('Negatives', function () {
|
||||
context('Publication Creation', function () {
|
||||
it('user should fail to post with timed fee collect module using unwhitelisted currency', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[DEFAULT_COLLECT_PRICE, userTwoAddress, userAddress, REFERRAL_FEE_BPS, true]
|
||||
);
|
||||
@@ -61,15 +61,15 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: timedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID);
|
||||
});
|
||||
|
||||
it('user should fail to post with timed fee collect module using zero recipient', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[DEFAULT_COLLECT_PRICE, currency.address, ZERO_ADDRESS, REFERRAL_FEE_BPS, true]
|
||||
);
|
||||
@@ -78,15 +78,15 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: timedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID);
|
||||
});
|
||||
|
||||
it('user should fail to post with timed fee collect module using referral fee greater than max BPS', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[DEFAULT_COLLECT_PRICE, currency.address, userAddress, 10001, true]
|
||||
);
|
||||
@@ -95,15 +95,15 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: timedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID);
|
||||
});
|
||||
|
||||
it('user should fail to post with timed fee collect module using zero amount', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[0, currency.address, userAddress, REFERRAL_FEE_BPS, true]
|
||||
);
|
||||
@@ -112,9 +112,9 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: timedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID);
|
||||
});
|
||||
@@ -122,7 +122,7 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
|
||||
context('Collecting', function () {
|
||||
beforeEach(async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[DEFAULT_COLLECT_PRICE, currency.address, userAddress, REFERRAL_FEE_BPS, true]
|
||||
);
|
||||
@@ -131,9 +131,9 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: timedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
});
|
||||
@@ -186,7 +186,7 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -195,8 +195,9 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -313,7 +314,7 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -322,8 +323,9 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -344,7 +346,7 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -353,8 +355,9 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -380,7 +383,7 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -389,8 +392,9 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -413,7 +417,7 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -422,8 +426,9 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -439,7 +444,7 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
|
||||
context('Scenarios', function () {
|
||||
it('User should post with timed fee collect module as the collect module and data, correct events should be emitted', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[DEFAULT_COLLECT_PRICE, currency.address, userAddress, REFERRAL_FEE_BPS, true]
|
||||
);
|
||||
@@ -448,9 +453,9 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: timedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
});
|
||||
|
||||
const receipt = await waitForTx(tx);
|
||||
@@ -476,7 +481,7 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
});
|
||||
|
||||
it('User should post with timed fee collect module as the collect module and data, fetched publication data should be accurate', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[DEFAULT_COLLECT_PRICE, currency.address, userAddress, REFERRAL_FEE_BPS, true]
|
||||
);
|
||||
@@ -485,9 +490,9 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: timedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
const postTimestamp = await getTimestamp();
|
||||
@@ -502,7 +507,7 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
});
|
||||
|
||||
it('User should post with timed fee collect module as the collect module and data, allowing non-followers to collect, user two collects without following, fee distribution is valid', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[DEFAULT_COLLECT_PRICE, currency.address, userAddress, REFERRAL_FEE_BPS, false]
|
||||
);
|
||||
@@ -511,9 +516,9 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: timedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -541,7 +546,7 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
});
|
||||
|
||||
it('User should post with timed fee collect module as the collect module and data, user two follows, then collects and pays fee, fee distribution is valid', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[DEFAULT_COLLECT_PRICE, currency.address, userAddress, REFERRAL_FEE_BPS, true]
|
||||
);
|
||||
@@ -550,9 +555,9 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: timedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -581,7 +586,7 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
});
|
||||
|
||||
it('User should post with timed fee collect module as the collect module and data, user two follows, then collects twice, fee distribution is valid', async function () {
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[DEFAULT_COLLECT_PRICE, currency.address, userAddress, REFERRAL_FEE_BPS, true]
|
||||
);
|
||||
@@ -590,9 +595,9 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: timedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -623,7 +628,7 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
|
||||
it('User should post with timed fee collect module as the collect module and data, user two mirrors, follows, then collects from their mirror and pays fee, fee distribution is valid', async function () {
|
||||
const secondProfileId = FIRST_PROFILE_ID + 1;
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[DEFAULT_COLLECT_PRICE, currency.address, userAddress, REFERRAL_FEE_BPS, true]
|
||||
);
|
||||
@@ -632,9 +637,9 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: timedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -644,7 +649,7 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -653,8 +658,9 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -690,7 +696,7 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
|
||||
it('User should post with timed fee collect module as the collect module and data, with no referral fee, user two mirrors, follows, then collects from their mirror and pays fee, fee distribution is valid', async function () {
|
||||
const secondProfileId = FIRST_PROFILE_ID + 1;
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[DEFAULT_COLLECT_PRICE, currency.address, userAddress, 0, true]
|
||||
);
|
||||
@@ -699,9 +705,9 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: timedFeeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -711,7 +717,7 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -720,8 +726,9 @@ makeSuiteCleanRoom('Timed Fee Collect Module', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ makeSuiteCleanRoom('Approval Follow Module', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -117,7 +117,7 @@ makeSuiteCleanRoom('Approval Follow Module', function () {
|
||||
handle: 'secondhandle',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: approvalFollowModule.address,
|
||||
followModuleData: data,
|
||||
followModuleInitData: data,
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
});
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ makeSuiteCleanRoom('Fee Follow Module', function () {
|
||||
context('Negatives', function () {
|
||||
context('Initialization', function () {
|
||||
it('user should fail to create a profile with fee follow module using unwhitelisted currency', async function () {
|
||||
const followModuleData = abiCoder.encode(
|
||||
const followModuleInitData = abiCoder.encode(
|
||||
['uint256', 'address', 'address'],
|
||||
[DEFAULT_FOLLOW_PRICE, userTwoAddress, userAddress]
|
||||
);
|
||||
@@ -52,14 +52,14 @@ makeSuiteCleanRoom('Fee Follow Module', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: feeFollowModule.address,
|
||||
followModuleData: followModuleData,
|
||||
followModuleInitData: followModuleInitData,
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID);
|
||||
});
|
||||
|
||||
it('user should fail to create a profile with fee follow module using zero recipient', async function () {
|
||||
const followModuleData = abiCoder.encode(
|
||||
const followModuleInitData = abiCoder.encode(
|
||||
['uint256', 'address', 'address'],
|
||||
[DEFAULT_FOLLOW_PRICE, currency.address, ZERO_ADDRESS]
|
||||
);
|
||||
@@ -70,14 +70,14 @@ makeSuiteCleanRoom('Fee Follow Module', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: feeFollowModule.address,
|
||||
followModuleData: followModuleData,
|
||||
followModuleInitData: followModuleInitData,
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID);
|
||||
});
|
||||
|
||||
it('user should fail to create a profile with fee follow module using zero amount', async function () {
|
||||
const followModuleData = abiCoder.encode(
|
||||
const followModuleInitData = abiCoder.encode(
|
||||
['uint256', 'address', 'address'],
|
||||
[0, currency.address, userAddress]
|
||||
);
|
||||
@@ -88,7 +88,7 @@ makeSuiteCleanRoom('Fee Follow Module', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: feeFollowModule.address,
|
||||
followModuleData: followModuleData,
|
||||
followModuleInitData: followModuleInitData,
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.INIT_PARAMS_INVALID);
|
||||
@@ -97,7 +97,7 @@ makeSuiteCleanRoom('Fee Follow Module', function () {
|
||||
|
||||
context('Following', function () {
|
||||
beforeEach(async function () {
|
||||
const followModuleData = abiCoder.encode(
|
||||
const followModuleInitData = abiCoder.encode(
|
||||
['uint256', 'address', 'address'],
|
||||
[DEFAULT_FOLLOW_PRICE, currency.address, userAddress]
|
||||
);
|
||||
@@ -107,7 +107,7 @@ makeSuiteCleanRoom('Fee Follow Module', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: feeFollowModule.address,
|
||||
followModuleData: followModuleData,
|
||||
followModuleInitData: followModuleInitData,
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -182,7 +182,7 @@ makeSuiteCleanRoom('Fee Follow Module', function () {
|
||||
|
||||
context('Scenarios', function () {
|
||||
it('User should create a profile with the fee follow module as the follow module and data, correct events should be emitted', async function () {
|
||||
const followModuleData = abiCoder.encode(
|
||||
const followModuleInitData = abiCoder.encode(
|
||||
['uint256', 'address', 'address'],
|
||||
[DEFAULT_FOLLOW_PRICE, currency.address, userAddress]
|
||||
);
|
||||
@@ -191,7 +191,7 @@ makeSuiteCleanRoom('Fee Follow Module', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: feeFollowModule.address,
|
||||
followModuleData: followModuleData,
|
||||
followModuleInitData: followModuleInitData,
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
});
|
||||
|
||||
@@ -206,7 +206,7 @@ makeSuiteCleanRoom('Fee Follow Module', function () {
|
||||
MOCK_PROFILE_HANDLE,
|
||||
MOCK_PROFILE_URI,
|
||||
feeFollowModule.address,
|
||||
followModuleData,
|
||||
followModuleInitData,
|
||||
MOCK_FOLLOW_NFT_URI,
|
||||
await getTimestamp(),
|
||||
]);
|
||||
@@ -219,19 +219,19 @@ makeSuiteCleanRoom('Fee Follow Module', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
const followModuleData = abiCoder.encode(
|
||||
const followModuleInitData = abiCoder.encode(
|
||||
['uint256', 'address', 'address'],
|
||||
[DEFAULT_FOLLOW_PRICE, currency.address, userAddress]
|
||||
);
|
||||
const tx = lensHub.setFollowModule(
|
||||
FIRST_PROFILE_ID,
|
||||
feeFollowModule.address,
|
||||
followModuleData
|
||||
followModuleInitData
|
||||
);
|
||||
|
||||
const receipt = await waitForTx(tx);
|
||||
@@ -240,13 +240,13 @@ makeSuiteCleanRoom('Fee Follow Module', function () {
|
||||
matchEvent(receipt, 'FollowModuleSet', [
|
||||
FIRST_PROFILE_ID,
|
||||
feeFollowModule.address,
|
||||
followModuleData,
|
||||
followModuleInitData,
|
||||
await getTimestamp(),
|
||||
]);
|
||||
});
|
||||
|
||||
it('User should create a profile with the fee follow module as the follow module and data, fetched profile data should be accurate', async function () {
|
||||
const followModuleData = abiCoder.encode(
|
||||
const followModuleInitData = abiCoder.encode(
|
||||
['uint256', 'address', 'address'],
|
||||
[DEFAULT_FOLLOW_PRICE, currency.address, userAddress]
|
||||
);
|
||||
@@ -256,7 +256,7 @@ makeSuiteCleanRoom('Fee Follow Module', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: feeFollowModule.address,
|
||||
followModuleData: followModuleData,
|
||||
followModuleInitData: followModuleInitData,
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -268,7 +268,7 @@ makeSuiteCleanRoom('Fee Follow Module', function () {
|
||||
});
|
||||
|
||||
it('User should create a profile with the fee follow module as the follow module and data, user two follows, fee distribution is valid', async function () {
|
||||
const followModuleData = abiCoder.encode(
|
||||
const followModuleInitData = abiCoder.encode(
|
||||
['uint256', 'address', 'address'],
|
||||
[DEFAULT_FOLLOW_PRICE, currency.address, userAddress]
|
||||
);
|
||||
@@ -278,7 +278,7 @@ makeSuiteCleanRoom('Fee Follow Module', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: feeFollowModule.address,
|
||||
followModuleData: followModuleData,
|
||||
followModuleInitData: followModuleInitData,
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -307,7 +307,7 @@ makeSuiteCleanRoom('Fee Follow Module', function () {
|
||||
});
|
||||
|
||||
it('User should create a profile with the fee follow module as the follow module and data, user two follows twice, fee distribution is valid', async function () {
|
||||
const followModuleData = abiCoder.encode(
|
||||
const followModuleInitData = abiCoder.encode(
|
||||
['uint256', 'address', 'address'],
|
||||
[DEFAULT_FOLLOW_PRICE, currency.address, userAddress]
|
||||
);
|
||||
@@ -317,7 +317,7 @@ makeSuiteCleanRoom('Fee Follow Module', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: feeFollowModule.address,
|
||||
followModuleData: followModuleData,
|
||||
followModuleInitData: followModuleInitData,
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -56,7 +56,7 @@ makeSuiteCleanRoom('Profile Follow Module', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: profileFollowModule.address,
|
||||
followModuleData: DEFAULT_INIT_DATA,
|
||||
followModuleInitData: DEFAULT_INIT_DATA,
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -89,7 +89,7 @@ makeSuiteCleanRoom('Profile Follow Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -108,7 +108,7 @@ makeSuiteCleanRoom('Profile Follow Module', function () {
|
||||
handle: 'user',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -125,7 +125,7 @@ makeSuiteCleanRoom('Profile Follow Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -144,7 +144,7 @@ makeSuiteCleanRoom('Profile Follow Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -178,7 +178,7 @@ makeSuiteCleanRoom('Profile Follow Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -212,7 +212,7 @@ makeSuiteCleanRoom('Profile Follow Module', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: profileFollowModule.address,
|
||||
followModuleData: DEFAULT_INIT_DATA,
|
||||
followModuleInitData: DEFAULT_INIT_DATA,
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
});
|
||||
|
||||
@@ -240,7 +240,7 @@ makeSuiteCleanRoom('Profile Follow Module', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -271,7 +271,7 @@ makeSuiteCleanRoom('Profile Follow Module', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: profileFollowModule.address,
|
||||
followModuleData: DEFAULT_INIT_DATA,
|
||||
followModuleInitData: DEFAULT_INIT_DATA,
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -284,7 +284,7 @@ makeSuiteCleanRoom('Profile Follow Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -300,7 +300,7 @@ makeSuiteCleanRoom('Profile Follow Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -324,7 +324,7 @@ makeSuiteCleanRoom('Profile Follow Module', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -334,7 +334,7 @@ makeSuiteCleanRoom('Profile Follow Module', function () {
|
||||
handle: 'usertwo2',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -33,7 +33,7 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -43,7 +43,7 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () {
|
||||
handle: 'user2',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -60,9 +60,9 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: followerOnlyReferenceModule.address,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
});
|
||||
@@ -78,9 +78,10 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () {
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.FOLLOW_INVALID);
|
||||
});
|
||||
@@ -103,9 +104,10 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () {
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.FOLLOW_INVALID);
|
||||
});
|
||||
@@ -118,8 +120,9 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () {
|
||||
profileId: SECOND_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.FOLLOW_INVALID);
|
||||
});
|
||||
@@ -140,8 +143,9 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () {
|
||||
profileId: SECOND_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.be.revertedWith(ERRORS.FOLLOW_INVALID);
|
||||
});
|
||||
@@ -155,9 +159,9 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: followerOnlyReferenceModule.address,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
});
|
||||
const receipt = await waitForTx(tx);
|
||||
|
||||
@@ -190,9 +194,10 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () {
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
});
|
||||
@@ -210,10 +215,11 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () {
|
||||
contentURI: MOCK_URI,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
});
|
||||
@@ -225,10 +231,11 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () {
|
||||
contentURI: MOCK_URI,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
});
|
||||
@@ -248,10 +255,11 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () {
|
||||
contentURI: MOCK_URI,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
});
|
||||
@@ -276,9 +284,10 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () {
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
});
|
||||
@@ -297,8 +306,9 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () {
|
||||
profileId: SECOND_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
});
|
||||
@@ -321,8 +331,9 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () {
|
||||
profileId: SECOND_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
});
|
||||
@@ -339,8 +350,9 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
});
|
||||
@@ -351,8 +363,9 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
});
|
||||
@@ -371,8 +384,9 @@ makeSuiteCleanRoom('Follower Only Reference Module', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
});
|
||||
|
||||
@@ -31,7 +31,7 @@ makeSuiteCleanRoom('Collect NFT', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -40,9 +40,9 @@ makeSuiteCleanRoom('Collect NFT', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
await expect(lensHub.follow([FIRST_PROFILE_ID], [[]])).to.not.be.reverted;
|
||||
|
||||
@@ -34,7 +34,7 @@ makeSuiteCleanRoom('Follow NFT', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -56,7 +56,7 @@ makeSuiteCleanRoom('Lens NFT Base Functionality', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -230,7 +230,7 @@ makeSuiteCleanRoom('Events', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
);
|
||||
@@ -243,7 +243,7 @@ makeSuiteCleanRoom('Events', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
);
|
||||
@@ -275,7 +275,7 @@ makeSuiteCleanRoom('Events', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
);
|
||||
@@ -336,9 +336,9 @@ makeSuiteCleanRoom('Events', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
);
|
||||
|
||||
@@ -366,9 +366,9 @@ makeSuiteCleanRoom('Events', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
);
|
||||
|
||||
@@ -378,10 +378,11 @@ makeSuiteCleanRoom('Events', function () {
|
||||
contentURI: MOCK_URI,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
);
|
||||
|
||||
@@ -393,6 +394,7 @@ makeSuiteCleanRoom('Events', function () {
|
||||
MOCK_URI,
|
||||
FIRST_PROFILE_ID,
|
||||
1,
|
||||
[],
|
||||
freeCollectModule.address,
|
||||
abiCoder.encode(['bool'], [true]),
|
||||
ZERO_ADDRESS,
|
||||
@@ -412,9 +414,9 @@ makeSuiteCleanRoom('Events', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
);
|
||||
|
||||
@@ -423,8 +425,9 @@ makeSuiteCleanRoom('Events', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
);
|
||||
|
||||
@@ -435,6 +438,7 @@ makeSuiteCleanRoom('Events', function () {
|
||||
2,
|
||||
FIRST_PROFILE_ID,
|
||||
1,
|
||||
[],
|
||||
ZERO_ADDRESS,
|
||||
[],
|
||||
await getTimestamp(),
|
||||
@@ -485,7 +489,7 @@ makeSuiteCleanRoom('Events', function () {
|
||||
).to.not.be.reverted;
|
||||
|
||||
const collectPrice = 1;
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[collectPrice, currency.address, userAddress, 0, true]
|
||||
);
|
||||
@@ -494,9 +498,9 @@ makeSuiteCleanRoom('Events', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: feeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
);
|
||||
|
||||
@@ -553,7 +557,7 @@ makeSuiteCleanRoom('Events', function () {
|
||||
).to.not.be.reverted;
|
||||
|
||||
const collectPrice = 1;
|
||||
const collectModuleData = abiCoder.encode(
|
||||
const collectModuleInitData = abiCoder.encode(
|
||||
['uint256', 'address', 'address', 'uint16', 'bool'],
|
||||
[collectPrice, currency.address, userAddress, 0, true]
|
||||
);
|
||||
@@ -562,9 +566,9 @@ makeSuiteCleanRoom('Events', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: feeCollectModule.address,
|
||||
collectModuleData: collectModuleData,
|
||||
collectModuleInitData: collectModuleInitData,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
);
|
||||
|
||||
@@ -576,7 +580,7 @@ makeSuiteCleanRoom('Events', function () {
|
||||
handle: 'usertwo',
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
);
|
||||
@@ -586,8 +590,9 @@ makeSuiteCleanRoom('Events', function () {
|
||||
profileId: secondProfileId,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
);
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ makeSuiteCleanRoom('Misc', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -158,9 +158,9 @@ makeSuiteCleanRoom('Misc', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
}
|
||||
@@ -200,9 +200,9 @@ makeSuiteCleanRoom('Misc', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
expect(await lensHub.getReferenceModule(FIRST_PROFILE_ID, 1)).to.eq(ZERO_ADDRESS);
|
||||
@@ -212,9 +212,9 @@ makeSuiteCleanRoom('Misc', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: followerOnlyReferenceModule.address,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
expect(await lensHub.getReferenceModule(FIRST_PROFILE_ID, 2)).to.eq(
|
||||
@@ -232,9 +232,9 @@ makeSuiteCleanRoom('Misc', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -253,9 +253,9 @@ makeSuiteCleanRoom('Misc', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -265,10 +265,11 @@ makeSuiteCleanRoom('Misc', function () {
|
||||
contentURI: MOCK_URI,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -287,9 +288,9 @@ makeSuiteCleanRoom('Misc', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -298,8 +299,9 @@ makeSuiteCleanRoom('Misc', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -318,9 +320,9 @@ makeSuiteCleanRoom('Misc', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -337,9 +339,9 @@ makeSuiteCleanRoom('Misc', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -349,10 +351,11 @@ makeSuiteCleanRoom('Misc', function () {
|
||||
contentURI: OTHER_MOCK_URI,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -369,9 +372,9 @@ makeSuiteCleanRoom('Misc', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -380,8 +383,9 @@ makeSuiteCleanRoom('Misc', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
expect(await lensHub.getContentURI(FIRST_PROFILE_ID, 2)).to.eq(MOCK_URI);
|
||||
@@ -397,9 +401,9 @@ makeSuiteCleanRoom('Misc', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -416,9 +420,9 @@ makeSuiteCleanRoom('Misc', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -427,8 +431,9 @@ makeSuiteCleanRoom('Misc', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -438,10 +443,11 @@ makeSuiteCleanRoom('Misc', function () {
|
||||
contentURI: OTHER_MOCK_URI,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 2,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -458,9 +464,9 @@ makeSuiteCleanRoom('Misc', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -469,8 +475,9 @@ makeSuiteCleanRoom('Misc', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -487,9 +494,9 @@ makeSuiteCleanRoom('Misc', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: MOCK_URI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -499,10 +506,11 @@ makeSuiteCleanRoom('Misc', function () {
|
||||
contentURI: OTHER_MOCK_URI,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -511,8 +519,9 @@ makeSuiteCleanRoom('Misc', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
profileIdPointed: FIRST_PROFILE_ID,
|
||||
pubIdPointed: 1,
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -543,7 +552,7 @@ makeSuiteCleanRoom('Misc', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: approvalFollowModule.address,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -677,7 +686,7 @@ makeSuiteCleanRoom('Misc', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -695,9 +704,9 @@ makeSuiteCleanRoom('Misc', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: firstURI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -706,9 +715,9 @@ makeSuiteCleanRoom('Misc', function () {
|
||||
profileId: FIRST_PROFILE_ID,
|
||||
contentURI: secondURI,
|
||||
collectModule: freeCollectModule.address,
|
||||
collectModuleData: abiCoder.encode(['bool'], [true]),
|
||||
collectModuleInitData: abiCoder.encode(['bool'], [true]),
|
||||
referenceModule: ZERO_ADDRESS,
|
||||
referenceModuleData: [],
|
||||
referenceModuleInitData: [],
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -764,7 +773,7 @@ makeSuiteCleanRoom('Misc', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -834,7 +843,7 @@ makeSuiteCleanRoom('Misc', function () {
|
||||
handle: 'otherhandle',
|
||||
imageURI: OTHER_MOCK_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -1055,7 +1064,7 @@ makeSuiteCleanRoom('Misc', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
@@ -1148,7 +1157,7 @@ makeSuiteCleanRoom('Misc', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
@@ -58,7 +58,7 @@ makeSuiteCleanRoom('Mock Profile Creation Proxy', function () {
|
||||
handle: MOCK_PROFILE_HANDLE,
|
||||
imageURI: MOCK_PROFILE_URI,
|
||||
followModule: ZERO_ADDRESS,
|
||||
followModuleData: [],
|
||||
followModuleInitData: [],
|
||||
followNFTURI: MOCK_FOLLOW_NFT_URI,
|
||||
})
|
||||
).to.not.be.reverted;
|
||||
|
||||
Reference in New Issue
Block a user