Merge pull request #1 from aave/fix/set-follow-nft-uri-with-sig

Fix: Fix `setFollowNFTURIWithSig()` function to properly set the follow NFT URI.
This commit is contained in:
Zer0dot
2022-01-27 11:21:42 -05:00
committed by GitHub
2 changed files with 14 additions and 1 deletions

View File

@@ -322,6 +322,7 @@ contract LensHub is ILensHub, LensNFTBase, VersionedInitializable, LensMultiStat
}
_validateRecoveredAddress(digest, owner, vars.sig);
_setFollowNFTURI(vars.profileId, vars.followNFTURI);
}
/// @inheritdoc ILensHub

View File

@@ -297,6 +297,8 @@ makeSuiteCleanRoom('Profile URI Functionality', function () {
MAX_UINT256
);
const profileImageURIBefore = await lensHub.tokenURI(FIRST_PROFILE_ID);
await expect(
lensHub.setProfileImageURIWithSig({
profileId: FIRST_PROFILE_ID,
@@ -310,7 +312,10 @@ makeSuiteCleanRoom('Profile URI Functionality', function () {
})
).to.not.be.reverted;
expect(await lensHub.tokenURI(FIRST_PROFILE_ID)).to.eq(MOCK_URI);
const profileImageURIAfter = await lensHub.tokenURI(FIRST_PROFILE_ID);
expect(profileImageURIBefore).to.eq(MOCK_PROFILE_URI);
expect(profileImageURIAfter).to.eq(MOCK_URI);
});
it('TestWallet should set the follow NFT URI with sig', async function () {
@@ -322,6 +327,8 @@ makeSuiteCleanRoom('Profile URI Functionality', function () {
MAX_UINT256
);
const followNFTURIBefore = await lensHub.getFollowNFTURI(FIRST_PROFILE_ID);
await expect(
lensHub.setFollowNFTURIWithSig({
profileId: FIRST_PROFILE_ID,
@@ -334,6 +341,11 @@ makeSuiteCleanRoom('Profile URI Functionality', function () {
},
})
).to.not.be.reverted;
const followNFTURIAfter = await lensHub.getFollowNFTURI(FIRST_PROFILE_ID);
expect(followNFTURIBefore).to.eq(MOCK_FOLLOW_NFT_URI);
expect(followNFTURIAfter).to.eq(MOCK_URI);
});
});
});