diff --git a/tests/LSP20CallVerification/LSP6/Admin/PermissionChangeAddExtensions.test.ts b/tests/LSP20CallVerification/LSP6/Admin/PermissionChangeAddExtensions.test.ts index 7c7412290..75363c66e 100644 --- a/tests/LSP20CallVerification/LSP6/Admin/PermissionChangeAddExtensions.test.ts +++ b/tests/LSP20CallVerification/LSP6/Admin/PermissionChangeAddExtensions.test.ts @@ -552,7 +552,7 @@ export const shouldBehaveLikePermissionChangeOrAddExtensions = ( ], dataValues: [ extensionB, - ethers.utils.hexZeroPad(ethers.utils.hexlify(8), 32), + ethers.utils.hexZeroPad(ethers.utils.hexlify(8), 16), '0xaabb', ], }; diff --git a/tests/LSP20CallVerification/LSP6/SetPermissions/PermissionChangeAddController.test.ts b/tests/LSP20CallVerification/LSP6/SetPermissions/PermissionChangeAddController.test.ts index 4463d3b4d..ed582b940 100644 --- a/tests/LSP20CallVerification/LSP6/SetPermissions/PermissionChangeAddController.test.ts +++ b/tests/LSP20CallVerification/LSP6/SetPermissions/PermissionChangeAddController.test.ts @@ -220,11 +220,8 @@ export const shouldBehaveLikePermissionChangeOrAddController = ( // set some random bytes under AddressPermissions[7] await expect(context.universalProfile.connect(context.owner).setData(key, randomValue)) - .to.be.revertedWithCustomError( - context.keyManager, - 'AddressPermissionArrayIndexValueNotAnAddress', - ) - .withArgs(key, randomValue); + .to.be.revertedWithCustomError(context.keyManager, 'InvalidDataValuesForDataKeys') + .withArgs(key, randomValue, 20); }); it('should revert when setting a random 30 bytes value', async () => { @@ -236,11 +233,8 @@ export const shouldBehaveLikePermissionChangeOrAddController = ( // set some random bytes under AddressPermissions[7] await expect(context.universalProfile.connect(context.owner).setData(key, randomValue)) - .to.be.revertedWithCustomError( - context.keyManager, - 'AddressPermissionArrayIndexValueNotAnAddress', - ) - .withArgs(key, randomValue); + .to.be.revertedWithCustomError(context.keyManager, 'InvalidDataValuesForDataKeys') + .withArgs(key, randomValue, 20); }); }); @@ -270,11 +264,8 @@ export const shouldBehaveLikePermissionChangeOrAddController = ( // set some random bytes under AddressPermissions[7] await expect(context.universalProfile.connect(context.owner).setData(key, randomValue)) - .to.be.revertedWithCustomError( - context.keyManager, - 'AddressPermissionArrayIndexValueNotAnAddress', - ) - .withArgs(key, randomValue); + .to.be.revertedWithCustomError(context.keyManager, 'InvalidDataValuesForDataKeys') + .withArgs(key, randomValue, 20); }); it('should revert when setting a random 30 bytes value', async () => { @@ -286,11 +277,8 @@ export const shouldBehaveLikePermissionChangeOrAddController = ( // set some random bytes under AddressPermissions[7] await expect(context.universalProfile.connect(context.owner).setData(key, randomValue)) - .to.be.revertedWithCustomError( - context.keyManager, - 'AddressPermissionArrayIndexValueNotAnAddress', - ) - .withArgs(key, randomValue); + .to.be.revertedWithCustomError(context.keyManager, 'InvalidDataValuesForDataKeys') + .withArgs(key, randomValue, 20); }); }); @@ -434,11 +422,8 @@ export const shouldBehaveLikePermissionChangeOrAddController = ( await expect( context.universalProfile.connect(canOnlyAddController).setData(key, randomValue), ) - .to.be.revertedWithCustomError( - context.keyManager, - 'AddressPermissionArrayIndexValueNotAnAddress', - ) - .withArgs(key, randomValue); + .to.be.revertedWithCustomError(context.keyManager, 'InvalidDataValuesForDataKeys') + .withArgs(key, randomValue, 20); }); it('should revert when setting a random 30 bytes value', async () => { @@ -450,11 +435,8 @@ export const shouldBehaveLikePermissionChangeOrAddController = ( await expect( context.universalProfile.connect(canOnlyAddController).setData(key, randomValue), ) - .to.be.revertedWithCustomError( - context.keyManager, - 'AddressPermissionArrayIndexValueNotAnAddress', - ) - .withArgs(key, randomValue); + .to.be.revertedWithCustomError(context.keyManager, 'InvalidDataValuesForDataKeys') + .withArgs(key, randomValue, 20); }); }); @@ -590,7 +572,7 @@ export const shouldBehaveLikePermissionChangeOrAddController = ( const newLength = ethers.BigNumber.from(currentLength).sub(1).toNumber(); - const value = ethers.utils.hexZeroPad(ethers.utils.hexlify(newLength), 32); + const value = ethers.utils.hexZeroPad(ethers.utils.hexlify(newLength), 16); await context.universalProfile.connect(canOnlyEditPermissions).setData(key, value); @@ -643,11 +625,8 @@ export const shouldBehaveLikePermissionChangeOrAddController = ( await expect( context.universalProfile.connect(canOnlyEditPermissions).setData(key, randomValue), ) - .to.be.revertedWithCustomError( - context.keyManager, - 'AddressPermissionArrayIndexValueNotAnAddress', - ) - .withArgs(key, randomValue); + .to.be.revertedWithCustomError(context.keyManager, 'InvalidDataValuesForDataKeys') + .withArgs(key, randomValue, 20); }); it('should revert when setting a random 30 bytes value', async () => { @@ -661,11 +640,8 @@ export const shouldBehaveLikePermissionChangeOrAddController = ( await expect( context.universalProfile.connect(canOnlyEditPermissions).setData(key, randomValue), ) - .to.be.revertedWithCustomError( - context.keyManager, - 'AddressPermissionArrayIndexValueNotAnAddress', - ) - .withArgs(key, randomValue); + .to.be.revertedWithCustomError(context.keyManager, 'InvalidDataValuesForDataKeys') + .withArgs(key, randomValue, 20); }); }); diff --git a/tests/LSP6KeyManager/Admin/PermissionChangeAddExtensions.test.ts b/tests/LSP6KeyManager/Admin/PermissionChangeAddExtensions.test.ts index edf7f091d..dad51e43a 100644 --- a/tests/LSP6KeyManager/Admin/PermissionChangeAddExtensions.test.ts +++ b/tests/LSP6KeyManager/Admin/PermissionChangeAddExtensions.test.ts @@ -684,7 +684,7 @@ export const shouldBehaveLikePermissionChangeOrAddExtensions = ( ], dataValues: [ extensionB, - ethers.utils.hexZeroPad(ethers.utils.hexlify(8), 32), + ethers.utils.hexZeroPad(ethers.utils.hexlify(8), 16), '0xaabb', ], }; diff --git a/tests/LSP6KeyManager/LSP6ControlledToken.test.ts b/tests/LSP6KeyManager/LSP6ControlledToken.test.ts index 2df21cb3e..d81b9e6d8 100644 --- a/tests/LSP6KeyManager/LSP6ControlledToken.test.ts +++ b/tests/LSP6KeyManager/LSP6ControlledToken.test.ts @@ -431,7 +431,7 @@ describe('When deploying LSP7 with LSP6 as owner', () => { const key = ERC725YDataKeys.LSP6['AddressPermissions:Permissions'] + addressCanSetData.address.substring(2); - const value = ARRAY_LENGTH.ZERO; + const value = '0x'; const payload = context.token.interface.encodeFunctionData('setData', [key, value]); await expect(context.keyManager.connect(addressCanAddController).execute(payload)) @@ -443,7 +443,7 @@ describe('When deploying LSP7 with LSP6 as owner', () => { const key = ERC725YDataKeys.LSP6['AddressPermissions:Permissions'] + addressCanSetData.address.substring(2); - const value = ARRAY_LENGTH.ZERO; + const value = '0x'; const payload = context.token.interface.encodeFunctionData('setData', [key, value]); await context.keyManager.connect(context.owner).execute(payload); diff --git a/tests/LSP6KeyManager/SetPermissions/PermissionChangeAddController.test.ts b/tests/LSP6KeyManager/SetPermissions/PermissionChangeAddController.test.ts index 1562fa658..5c146710f 100644 --- a/tests/LSP6KeyManager/SetPermissions/PermissionChangeAddController.test.ts +++ b/tests/LSP6KeyManager/SetPermissions/PermissionChangeAddController.test.ts @@ -256,11 +256,8 @@ export const shouldBehaveLikePermissionChangeOrAddController = ( ]); await expect(context.keyManager.connect(context.owner).execute(setupPayload)) - .to.be.revertedWithCustomError( - context.keyManager, - 'AddressPermissionArrayIndexValueNotAnAddress', - ) - .withArgs(key, randomValue); + .to.be.revertedWithCustomError(context.keyManager, 'InvalidDataValuesForDataKeys') + .withArgs(key, randomValue, 20); }); it('should revert when setting a random 30 bytes value', async () => { @@ -274,11 +271,8 @@ export const shouldBehaveLikePermissionChangeOrAddController = ( ]); await expect(context.keyManager.connect(context.owner).execute(setupPayload)) - .to.be.revertedWithCustomError( - context.keyManager, - 'AddressPermissionArrayIndexValueNotAnAddress', - ) - .withArgs(key, randomValue); + .to.be.revertedWithCustomError(context.keyManager, 'InvalidDataValuesForDataKeys') + .withArgs(key, randomValue, 20); }); }); @@ -313,11 +307,8 @@ export const shouldBehaveLikePermissionChangeOrAddController = ( ]); await expect(context.keyManager.connect(context.owner).execute(setupPayload)) - .to.be.revertedWithCustomError( - context.keyManager, - 'AddressPermissionArrayIndexValueNotAnAddress', - ) - .withArgs(key, randomValue); + .to.be.revertedWithCustomError(context.keyManager, 'InvalidDataValuesForDataKeys') + .withArgs(key, randomValue, 20); }); it('should revert when setting a random 30 bytes value', async () => { @@ -331,11 +322,8 @@ export const shouldBehaveLikePermissionChangeOrAddController = ( ]); await expect(context.keyManager.connect(context.owner).execute(setupPayload)) - .to.be.revertedWithCustomError( - context.keyManager, - 'AddressPermissionArrayIndexValueNotAnAddress', - ) - .withArgs(key, randomValue); + .to.be.revertedWithCustomError(context.keyManager, 'InvalidDataValuesForDataKeys') + .withArgs(key, randomValue, 20); }); }); @@ -511,11 +499,8 @@ export const shouldBehaveLikePermissionChangeOrAddController = ( ]); await expect(context.keyManager.connect(canOnlyAddController).execute(setupPayload)) - .to.be.revertedWithCustomError( - context.keyManager, - 'AddressPermissionArrayIndexValueNotAnAddress', - ) - .withArgs(key, randomValue); + .to.be.revertedWithCustomError(context.keyManager, 'InvalidDataValuesForDataKeys') + .withArgs(key, randomValue, 20); }); it('should revert when setting a random 30 bytes value', async () => { @@ -529,11 +514,8 @@ export const shouldBehaveLikePermissionChangeOrAddController = ( ]); await expect(context.keyManager.connect(canOnlyAddController).execute(setupPayload)) - .to.be.revertedWithCustomError( - context.keyManager, - 'AddressPermissionArrayIndexValueNotAnAddress', - ) - .withArgs(key, randomValue); + .to.be.revertedWithCustomError(context.keyManager, 'InvalidDataValuesForDataKeys') + .withArgs(key, randomValue, 20); }); }); @@ -698,7 +680,7 @@ export const shouldBehaveLikePermissionChangeOrAddController = ( const newLength = ethers.BigNumber.from(currentLength).sub(1).toNumber(); - const value = ethers.utils.hexZeroPad(ethers.utils.hexlify(newLength), 32); + const value = ethers.utils.hexZeroPad(ethers.utils.hexlify(newLength), 16); const payload = context.universalProfile.interface.encodeFunctionData('setData', [ key, @@ -760,11 +742,8 @@ export const shouldBehaveLikePermissionChangeOrAddController = ( ]); await expect(context.keyManager.connect(canOnlyEditPermissions).execute(setupPayload)) - .to.be.revertedWithCustomError( - context.keyManager, - 'AddressPermissionArrayIndexValueNotAnAddress', - ) - .withArgs(key, randomValue); + .to.be.revertedWithCustomError(context.keyManager, 'InvalidDataValuesForDataKeys') + .withArgs(key, randomValue, 20); }); it('should revert when setting a random 30 bytes value', async () => { @@ -778,11 +757,8 @@ export const shouldBehaveLikePermissionChangeOrAddController = ( ]); await expect(context.keyManager.connect(canOnlyEditPermissions).execute(setupPayload)) - .to.be.revertedWithCustomError( - context.keyManager, - 'AddressPermissionArrayIndexValueNotAnAddress', - ) - .withArgs(key, randomValue); + .to.be.revertedWithCustomError(context.keyManager, 'InvalidDataValuesForDataKeys') + .withArgs(key, randomValue, 20); }); });