mirror of
https://github.com/lens-protocol/core.git
synced 2026-04-22 03:02:03 -04:00
misc: Moved negative test to correct section.
This commit is contained in:
@@ -402,6 +402,39 @@ makeSuiteCleanRoom('Lens NFT Base Functionality', function () {
|
||||
lensHub.burnWithSig(FIRST_PROFILE_ID, { v, r, s, deadline: MAX_UINT256 })
|
||||
).to.be.revertedWith(ERRORS.SIGNATURE_INVALID);
|
||||
});
|
||||
|
||||
it('TestWallet should deploy bad EIP1271 implementer, transfer NFT to it, sign message and permit user, permit should fail with invalid sig', async function () {
|
||||
const sigContract = await new BadMockEIP1271Implementer__factory(testWallet).deploy();
|
||||
const nonce = (await lensHub.sigNonces(sigContract.address)).toNumber();
|
||||
await expect(
|
||||
lensHub
|
||||
.connect(testWallet)
|
||||
.transferFrom(testWallet.address, sigContract.address, FIRST_PROFILE_ID)
|
||||
).to.not.be.reverted;
|
||||
|
||||
const { v, r, s } = await getPermitMessageParts(
|
||||
lensHub.address,
|
||||
LENS_HUB_NFT_NAME,
|
||||
userAddress,
|
||||
FIRST_PROFILE_ID,
|
||||
nonce,
|
||||
MAX_UINT256
|
||||
);
|
||||
|
||||
await expect(
|
||||
lensHub.permit(
|
||||
userAddress,
|
||||
FIRST_PROFILE_ID,
|
||||
{
|
||||
v,
|
||||
r,
|
||||
s,
|
||||
deadline: MAX_UINT256,
|
||||
},
|
||||
{ gasLimit: 12450000 }
|
||||
)
|
||||
).to.be.revertedWith(ERRORS.SIGNATURE_INVALID);
|
||||
});
|
||||
});
|
||||
|
||||
context('Scenarios', function () {
|
||||
@@ -524,39 +557,6 @@ makeSuiteCleanRoom('Lens NFT Base Functionality', function () {
|
||||
)
|
||||
).to.not.be.reverted;
|
||||
});
|
||||
|
||||
it('TestWallet should deploy bad EIP1271 implementer, transfer NFT to it, sign message and permit user, permit should fail with invalid sig', async function () {
|
||||
const sigContract = await new BadMockEIP1271Implementer__factory(testWallet).deploy();
|
||||
const nonce = (await lensHub.sigNonces(sigContract.address)).toNumber();
|
||||
await expect(
|
||||
lensHub
|
||||
.connect(testWallet)
|
||||
.transferFrom(testWallet.address, sigContract.address, FIRST_PROFILE_ID)
|
||||
).to.not.be.reverted;
|
||||
|
||||
const { v, r, s } = await getPermitMessageParts(
|
||||
lensHub.address,
|
||||
LENS_HUB_NFT_NAME,
|
||||
userAddress,
|
||||
FIRST_PROFILE_ID,
|
||||
nonce,
|
||||
MAX_UINT256
|
||||
);
|
||||
|
||||
await expect(
|
||||
lensHub.permit(
|
||||
userAddress,
|
||||
FIRST_PROFILE_ID,
|
||||
{
|
||||
v,
|
||||
r,
|
||||
s,
|
||||
deadline: MAX_UINT256,
|
||||
},
|
||||
{ gasLimit: 12450000 }
|
||||
)
|
||||
).to.be.revertedWith(ERRORS.SIGNATURE_INVALID);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user