Skip to content

Commit

Permalink
Merge pull request #732 from lukso-network/tests/naming
Browse files Browse the repository at this point in the history
tests: change name from `owner` to `mainController` in LSP6 tests
  • Loading branch information
CJ42 authored Oct 4, 2023
2 parents 0ae4c83 + ba501e2 commit 9173119
Show file tree
Hide file tree
Showing 52 changed files with 640 additions and 517 deletions.
136 changes: 72 additions & 64 deletions tests/Benchmark.test.ts

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2785,7 +2785,7 @@ export const shouldBehaveLikeLSP1Delegate = (

testContext = {
accounts: signerAddresses,
owner: profileOwner,
mainController: profileOwner,
universalProfile: deployedUniversalProfile,
keyManager: deployedKeyManager,
};
Expand All @@ -2803,7 +2803,9 @@ export const shouldBehaveLikeLSP1Delegate = (
[ERC725YDataKeys.LSP1.LSP1UniversalReceiverDelegate, lsp1Delegate.address],
);

await testContext.keyManager.connect(testContext.owner).execute(setLSP1DelegatePayload);
await testContext.keyManager
.connect(testContext.mainController)
.execute(setLSP1DelegatePayload);
});

it('check that the LSP9Vault address is not set under LSP10', async () => {
Expand Down Expand Up @@ -2848,7 +2850,7 @@ export const shouldBehaveLikeLSP1Delegate = (
[OPERATION_TYPES.CALL, vault.address, 0, transferOwnershipPayload],
);

await testContext.keyManager.connect(testContext.owner).execute(executePayload);
await testContext.keyManager.connect(testContext.mainController).execute(executePayload);

// check that the new vault owner is the pending owner
expect(await vault.pendingOwner()).to.equal(newVaultOwner.address);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ export const shouldBehaveLikePermissionChangeOrAddExtensions = (
canOnlyCall = context.accounts[6];

let permissionKeys = [
ERC725YDataKeys.LSP6['AddressPermissions:Permissions'] + context.owner.address.substring(2),
ERC725YDataKeys.LSP6['AddressPermissions:Permissions'] +
context.mainController.address.substring(2),
ERC725YDataKeys.LSP6['AddressPermissions:Permissions'] +
canAddAndChangeExtensions.address.substring(2),
ERC725YDataKeys.LSP6['AddressPermissions:Permissions'] +
Expand Down Expand Up @@ -126,7 +127,7 @@ export const shouldBehaveLikePermissionChangeOrAddExtensions = (

permissionArrayValues = [
ethers.utils.hexZeroPad(ethers.utils.hexlify(7), 16),
context.owner.address,
context.mainController.address,
canAddAndChangeExtensions.address,
canOnlyAddExtensions.address,
canOnlyChangeExtensions.address,
Expand All @@ -150,7 +151,7 @@ export const shouldBehaveLikePermissionChangeOrAddExtensions = (
};

await context.universalProfile
.connect(context.owner)
.connect(context.mainController)
.setData(payloadParam.dataKey, payloadParam.dataValue);

const result = await context.universalProfile.getData(payloadParam.dataKey);
Expand All @@ -164,7 +165,7 @@ export const shouldBehaveLikePermissionChangeOrAddExtensions = (
};

await context.universalProfile
.connect(context.owner)
.connect(context.mainController)
.setData(payloadParam.dataKey, payloadParam.dataValue);

const result = await context.universalProfile.getData(payloadParam.dataKey);
Expand All @@ -178,7 +179,7 @@ export const shouldBehaveLikePermissionChangeOrAddExtensions = (
};

await context.universalProfile
.connect(context.owner)
.connect(context.mainController)
.setData(payloadParam.dataKey, payloadParam.dataValue);

const result = await context.universalProfile.getData(payloadParam.dataKey);
Expand Down Expand Up @@ -348,7 +349,7 @@ export const shouldBehaveLikePermissionChangeOrAddExtensions = (
};

await context.universalProfile
.connect(context.owner)
.connect(context.mainController)
.setData(payloadParam.dataKey, payloadParam.dataValue);
});
it('should NOT be allowed to ADD another ExtensionHandler key', async () => {
Expand Down Expand Up @@ -407,7 +408,7 @@ export const shouldBehaveLikePermissionChangeOrAddExtensions = (
};

await context.universalProfile
.connect(context.owner)
.connect(context.mainController)
.setData(payloadParam.dataKey, payloadParam.dataValue);
});

Expand Down Expand Up @@ -467,7 +468,7 @@ export const shouldBehaveLikePermissionChangeOrAddExtensions = (
};

await context.universalProfile
.connect(context.owner)
.connect(context.mainController)
.setData(payloadParam.dataKey, payloadParam.dataValue);
});

Expand Down Expand Up @@ -535,7 +536,7 @@ export const shouldBehaveLikePermissionChangeOrAddExtensions = (
};

await context.universalProfile
.connect(context.owner)
.connect(context.mainController)
.setDataBatch(payloadParam.dataKeys, payloadParam.dataValues);

const result = await context.universalProfile.getDataBatch(payloadParam.dataKeys);
Expand All @@ -558,7 +559,7 @@ export const shouldBehaveLikePermissionChangeOrAddExtensions = (
};

await context.universalProfile
.connect(context.owner)
.connect(context.mainController)
.setDataBatch(payloadParam.dataKeys, payloadParam.dataValues);

const result = await context.universalProfile.getDataBatch(payloadParam.dataKeys);
Expand All @@ -577,7 +578,7 @@ export const shouldBehaveLikePermissionChangeOrAddExtensions = (
};

await context.universalProfile
.connect(context.owner)
.connect(context.mainController)
.setDataBatch(payloadParam.dataKeys, payloadParam.dataValues);

const result = await context.universalProfile.getDataBatch(payloadParam.dataKeys);
Expand Down Expand Up @@ -661,7 +662,7 @@ export const shouldBehaveLikePermissionChangeOrAddExtensions = (
};

await context.universalProfile
.connect(context.owner)
.connect(context.mainController)
.setDataBatch(payloadParam.dataKeys, payloadParam.dataValues);
});
describe('when adding multiple ExtensionHandler keys', () => {
Expand Down Expand Up @@ -936,7 +937,7 @@ export const shouldBehaveLikePermissionChangeOrAddExtensions = (
};

await context.universalProfile
.connect(context.owner)
.connect(context.mainController)
.setDataBatch(payloadParam.dataKeys, payloadParam.dataValues);
});
describe('When adding ExtensionHandler key and one of his allowedERC725Y Data Key', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ export const shouldBehaveLikePermissionChangeOrAddURD = (
canOnlyCall = context.accounts[6];

let permissionKeys = [
ERC725YDataKeys.LSP6['AddressPermissions:Permissions'] + context.owner.address.substring(2),
ERC725YDataKeys.LSP6['AddressPermissions:Permissions'] +
context.mainController.address.substring(2),
ERC725YDataKeys.LSP6['AddressPermissions:Permissions'] +
canAddAndChangeUniversalReceiverDelegate.address.substring(2),
ERC725YDataKeys.LSP6['AddressPermissions:Permissions'] +
Expand Down Expand Up @@ -128,7 +129,7 @@ export const shouldBehaveLikePermissionChangeOrAddURD = (

permissionArrayValues = [
ethers.utils.hexZeroPad(ethers.utils.hexlify(7), 16),
context.owner.address,
context.mainController.address,
canAddAndChangeUniversalReceiverDelegate.address,
canOnlyAddUniversalReceiverDelegate.address,
canOnlyChangeUniversalReceiverDelegate.address,
Expand All @@ -152,7 +153,7 @@ export const shouldBehaveLikePermissionChangeOrAddURD = (
};

await context.universalProfile
.connect(context.owner)
.connect(context.mainController)
.setData(payloadParam.dataKey, payloadParam.dataValue);

const result = await context.universalProfile.getData(payloadParam.dataKey);
Expand All @@ -166,7 +167,7 @@ export const shouldBehaveLikePermissionChangeOrAddURD = (
};

await context.universalProfile
.connect(context.owner)
.connect(context.mainController)
.setData(payloadParam.dataKey, payloadParam.dataValue);

const result = await context.universalProfile.getData(payloadParam.dataKey);
Expand All @@ -180,7 +181,7 @@ export const shouldBehaveLikePermissionChangeOrAddURD = (
};

await context.universalProfile
.connect(context.owner)
.connect(context.mainController)
.setData(payloadParam.dataKey, payloadParam.dataValue);

const result = await context.universalProfile.getData(payloadParam.dataKey);
Expand Down Expand Up @@ -362,7 +363,7 @@ export const shouldBehaveLikePermissionChangeOrAddURD = (
};

await context.universalProfile
.connect(context.owner)
.connect(context.mainController)
.setData(payloadParam.dataKey, payloadParam.dataValue);
});
it('should NOT be allowed to ADD another UniversalReceiverDelegate key', async () => {
Expand Down Expand Up @@ -421,7 +422,7 @@ export const shouldBehaveLikePermissionChangeOrAddURD = (
};

await context.universalProfile
.connect(context.owner)
.connect(context.mainController)
.setData(payloadParam.dataKey, payloadParam.dataValue);
});

Expand Down Expand Up @@ -481,7 +482,7 @@ export const shouldBehaveLikePermissionChangeOrAddURD = (
};

await context.universalProfile
.connect(context.owner)
.connect(context.mainController)
.setData(payloadParam.dataKey, payloadParam.dataValue);
});

Expand Down Expand Up @@ -549,7 +550,7 @@ export const shouldBehaveLikePermissionChangeOrAddURD = (
};

await context.universalProfile
.connect(context.owner)
.connect(context.mainController)
.setDataBatch(payloadParam.dataKeys, payloadParam.dataValues);

const result = await context.universalProfile.getDataBatch(payloadParam.dataKeys);
Expand All @@ -572,7 +573,7 @@ export const shouldBehaveLikePermissionChangeOrAddURD = (
};

await context.universalProfile
.connect(context.owner)
.connect(context.mainController)
.setDataBatch(payloadParam.dataKeys, payloadParam.dataValues);

const result = await context.universalProfile.getDataBatch(payloadParam.dataKeys);
Expand All @@ -591,7 +592,7 @@ export const shouldBehaveLikePermissionChangeOrAddURD = (
};

await context.universalProfile
.connect(context.owner)
.connect(context.mainController)
.setDataBatch(payloadParam.dataKeys, payloadParam.dataValues);

const result = await context.universalProfile.getDataBatch(payloadParam.dataKeys);
Expand Down Expand Up @@ -678,7 +679,7 @@ export const shouldBehaveLikePermissionChangeOrAddURD = (
};

await context.universalProfile
.connect(context.owner)
.connect(context.mainController)
.setDataBatch(payloadParam.dataKeys, payloadParam.dataValues);
});
describe('when adding multiple UniversalReceiverDelegate keys', () => {
Expand Down Expand Up @@ -981,7 +982,7 @@ export const shouldBehaveLikePermissionChangeOrAddURD = (
};

await context.universalProfile
.connect(context.owner)
.connect(context.mainController)
.setDataBatch(payloadParam.dataKeys, payloadParam.dataValues);
});
describe('When adding UniversalReceiverDelegate key and one of his allowedERC725Y Data Key', () => {
Expand Down
Loading

0 comments on commit 9173119

Please sign in to comment.