From 1ab05c37fbc0dbf8c585600680d75db257956159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8r=E2=88=82=C2=A1?= Date: Wed, 20 Sep 2023 10:49:03 +0100 Subject: [PATCH] Cosmetic change --- .../test/unit-testing/main-voting-plugin.ts | 126 +++--- .../member-access-execute-condition.ts | 42 +- .../test/unit-testing/member-access-plugin.ts | 366 +++++++++--------- .../personal-space-admin-plugin.ts | 14 +- .../test/unit-testing/space-plugin.ts | 10 +- 5 files changed, 279 insertions(+), 279 deletions(-) diff --git a/packages/contracts/test/unit-testing/main-voting-plugin.ts b/packages/contracts/test/unit-testing/main-voting-plugin.ts index 2c42482..98f2d5a 100644 --- a/packages/contracts/test/unit-testing/main-voting-plugin.ts +++ b/packages/contracts/test/unit-testing/main-voting-plugin.ts @@ -55,8 +55,8 @@ describe("Main Voting Plugin", function () { let signers: SignerWithAddress[]; let alice: SignerWithAddress; let bob: SignerWithAddress; - let charlie: SignerWithAddress; - let debbie: SignerWithAddress; + let carol: SignerWithAddress; + let dave: SignerWithAddress; let dao: DAO; let memberAccessPlugin: MemberAccessPlugin; let mainVotingPlugin: MainVotingPlugin; @@ -65,7 +65,7 @@ describe("Main Voting Plugin", function () { before(async () => { signers = await ethers.getSigners(); - [alice, bob, charlie, debbie] = signers; + [alice, bob, carol, dave] = signers; dao = await deployTestDao(alice); defaultInput = { contentUri: "ipfs://" }; @@ -231,7 +231,7 @@ describe("Main Voting Plugin", function () { ).to.not.be.reverted; await expect( - mainVotingPlugin.connect(charlie).createProposal( + mainVotingPlugin.connect(carol).createProposal( toUtf8Bytes("ipfs://"), [], 0, // fail safe @@ -244,10 +244,10 @@ describe("Main Voting Plugin", function () { mainVotingPlugin, "NotAMember", ) - .withArgs(charlie.address); + .withArgs(carol.address); await expect( - mainVotingPlugin.connect(debbie).createProposal( + mainVotingPlugin.connect(dave).createProposal( toUtf8Bytes("ipfs://"), [], 0, // fail safe @@ -260,7 +260,7 @@ describe("Main Voting Plugin", function () { mainVotingPlugin, "NotAMember", ) - .withArgs(debbie.address); + .withArgs(dave.address); }); it("Only editors can vote on proposals", async () => { @@ -283,14 +283,14 @@ describe("Main Voting Plugin", function () { await expect(mainVotingPlugin.connect(bob).vote(0, VoteOption.Yes, false)) .to.be.reverted; - // Charlie can't vote + // Carol can't vote await expect( - mainVotingPlugin.connect(charlie).vote(0, VoteOption.Yes, false), + mainVotingPlugin.connect(carol).vote(0, VoteOption.Yes, false), ).to.be.reverted; - // Debbie can't vote + // Dave can't vote await expect( - mainVotingPlugin.connect(debbie).vote(0, VoteOption.Yes, false), + mainVotingPlugin.connect(dave).vote(0, VoteOption.Yes, false), ) .to.be.reverted; @@ -369,27 +369,27 @@ describe("Main Voting Plugin", function () { expect(await memberAccessPlugin.isMember(alice.address)).to.eq(true); expect(await memberAccessPlugin.isMember(bob.address)).to.eq(true); - expect(await memberAccessPlugin.isMember(charlie.address)).to.eq(false); + expect(await memberAccessPlugin.isMember(carol.address)).to.eq(false); await dao.grant( mainVotingPlugin.address, - charlie.address, + carol.address, MEMBER_PERMISSION_ID, ); - expect(await memberAccessPlugin.isMember(charlie.address)).to.eq(true); + expect(await memberAccessPlugin.isMember(carol.address)).to.eq(true); await dao.revoke( mainVotingPlugin.address, - charlie.address, + carol.address, MEMBER_PERMISSION_ID, ); - expect(await memberAccessPlugin.isMember(charlie.address)).to.eq(false); + expect(await memberAccessPlugin.isMember(carol.address)).to.eq(false); - await makeEditor(charlie.address); + await makeEditor(carol.address); - expect(await memberAccessPlugin.isMember(charlie.address)).to.eq(true); + expect(await memberAccessPlugin.isMember(carol.address)).to.eq(true); }); it("isEditor() returns true when appropriate", async () => { @@ -399,11 +399,11 @@ describe("Main Voting Plugin", function () { expect(await memberAccessPlugin.isEditor(alice.address)).to.eq(true); expect(await memberAccessPlugin.isEditor(bob.address)).to.eq(false); - expect(await memberAccessPlugin.isEditor(charlie.address)).to.eq(false); + expect(await memberAccessPlugin.isEditor(carol.address)).to.eq(false); - await makeEditor(charlie.address); + await makeEditor(carol.address); - expect(await memberAccessPlugin.isEditor(charlie.address)).to.eq(true); + expect(await memberAccessPlugin.isEditor(carol.address)).to.eq(true); }); }); @@ -452,20 +452,20 @@ describe("Main Voting Plugin", function () { let pid = 0; // Bob editor await proposeNewEditor(bob.address); - // Charlie member + // Carol member await dao.grant( mainVotingPlugin.address, - charlie.address, + carol.address, MEMBER_PERMISSION_ID, ); - await expect(createDummyProposal(charlie, false)).to.not.be.reverted; + await expect(createDummyProposal(carol, false)).to.not.be.reverted; pid++; expect(await mainVotingPlugin.canExecute(pid)).to.eq(false); - // Charlie tries to vote + // Carol tries to vote await expect( - mainVotingPlugin.connect(charlie).vote(pid, VoteOption.Yes, true), + mainVotingPlugin.connect(carol).vote(pid, VoteOption.Yes, true), ).to.be.reverted; expect(await mainVotingPlugin.canExecute(pid)).to.eq(false); @@ -483,9 +483,9 @@ describe("Main Voting Plugin", function () { it("Proposals created by an editor require additional votes", async () => { let pid = 0; - // Bob and Charlie editors + // Bob and Carol editors await proposeNewEditor(bob.address); - await proposeNewEditor(charlie.address); + await proposeNewEditor(carol.address); pid++; await expect( mainVotingPlugin.connect(bob).vote(pid, VoteOption.Yes, true), @@ -529,30 +529,30 @@ describe("Main Voting Plugin", function () { expect(await mainVotingPlugin.addresslistLength()).to.eq(2); expect(await mainVotingPlugin.isEditor(bob.address)).to.eq(true); - // Propose Charlie - await proposeNewEditor(charlie.address); + // Propose Carol + await proposeNewEditor(carol.address); expect(await mainVotingPlugin.addresslistLength()).to.eq(2); - expect(await mainVotingPlugin.isEditor(charlie.address)).to.eq(false); + expect(await mainVotingPlugin.isEditor(carol.address)).to.eq(false); - // Confirm Charlie + // Confirm Carol await expect(mainVotingPlugin.connect(bob).vote(1, VoteOption.Yes, true)) .to .not.be.reverted; expect(await mainVotingPlugin.addresslistLength()).to.eq(3); - expect(await mainVotingPlugin.isEditor(charlie.address)).to.eq(true); + expect(await mainVotingPlugin.isEditor(carol.address)).to.eq(true); }); it("Removing an editor decreases the editorCount", async () => { - // Add Bob and Charlie + // Add Bob and Carol await proposeNewEditor(bob.address); // Alice votes yes as the creator - await proposeNewEditor(charlie.address); // Alice votes yes as the creator + await proposeNewEditor(carol.address); // Alice votes yes as the creator await expect(mainVotingPlugin.connect(bob).vote(1, VoteOption.Yes, true)) .to .not.be.reverted; expect(await mainVotingPlugin.addresslistLength()).to.eq(3); - // Propose removing Charlie - await proposeRemoveEditor(charlie.address); // Alice votes yes as the creator + // Propose removing Carol + await proposeRemoveEditor(carol.address); // Alice votes yes as the creator expect(await mainVotingPlugin.addresslistLength()).to.eq(3); await expect(mainVotingPlugin.connect(bob).vote(2, VoteOption.Yes, true)) .to @@ -575,7 +575,7 @@ describe("Main Voting Plugin", function () { value: 0, data: MainVotingPlugin__factory.createInterface() .encodeFunctionData("addAddresses", [ - [bob.address, charlie.address], + [bob.address, carol.address], ]), }, ]; @@ -592,7 +592,7 @@ describe("Main Voting Plugin", function () { value: 0, data: MainVotingPlugin__factory.createInterface() .encodeFunctionData("addAddresses", [ - [bob.address, charlie.address, debbie.address], + [bob.address, carol.address, dave.address], ]), }, ]; @@ -618,7 +618,7 @@ describe("Main Voting Plugin", function () { it("Removing more than one editor at once reverts", async () => { await makeEditor(bob.address); - await makeEditor(charlie.address); + await makeEditor(carol.address); // 2 let actions: IDAO.ActionStruct[] = [ @@ -627,7 +627,7 @@ describe("Main Voting Plugin", function () { value: 0, data: MainVotingPlugin__factory.createInterface() .encodeFunctionData("removeAddresses", [ - [bob.address, charlie.address], + [bob.address, carol.address], ]), }, ]; @@ -641,7 +641,7 @@ describe("Main Voting Plugin", function () { value: 0, data: MainVotingPlugin__factory.createInterface() .encodeFunctionData("removeAddresses", [ - [bob.address, charlie.address], + [bob.address, carol.address], ]), }, ]; @@ -699,8 +699,8 @@ describe("Main Voting Plugin", function () { // Add Bob await proposeNewEditor(bob.address); // Alice votes yes as the creator - // Propose Charlie - await proposeNewEditor(charlie.address); // Alice votes yes as the creator + // Propose Carol + await proposeNewEditor(carol.address); // Alice votes yes as the creator // Vote again await expect( @@ -714,8 +714,8 @@ describe("Main Voting Plugin", function () { await expect(createDummyProposal(bob, false)).to.not.be.reverted; expect(await mainVotingPlugin.canExecute(pid)).to.eq(false); - // Charlie cannot execute - await expect(mainVotingPlugin.connect(charlie).execute(pid)).to.be + // Carol cannot execute + await expect(mainVotingPlugin.connect(carol).execute(pid)).to.be .reverted; // Alice approves @@ -724,8 +724,8 @@ describe("Main Voting Plugin", function () { ).to.not.be.reverted; expect(await mainVotingPlugin.canExecute(pid)).to.eq(true); - // Charlie executes - await expect(mainVotingPlugin.connect(charlie).execute(pid)).to.not.be + // Carol executes + await expect(mainVotingPlugin.connect(carol).execute(pid)).to.not.be .reverted; }); @@ -734,8 +734,8 @@ describe("Main Voting Plugin", function () { await expect(createDummyProposal(bob, false)).to.not.be.reverted; expect(await mainVotingPlugin.canExecute(pid)).to.eq(false); - // Charlie cannot execute - await expect(mainVotingPlugin.connect(charlie).execute(pid)).to.be + // Carol cannot execute + await expect(mainVotingPlugin.connect(carol).execute(pid)).to.be .reverted; // Alice rejects @@ -744,8 +744,8 @@ describe("Main Voting Plugin", function () { ).to.not.be.reverted; expect(await mainVotingPlugin.canExecute(pid)).to.eq(false); - // Charlie cannot execute - await expect(mainVotingPlugin.connect(charlie).execute(pid)).to.be + // Carol cannot execute + await expect(mainVotingPlugin.connect(carol).execute(pid)).to.be .reverted; // @@ -757,8 +757,8 @@ describe("Main Voting Plugin", function () { pid++; expect(await mainVotingPlugin.canExecute(pid)).to.eq(false); - // Charlie cannot execute - await expect(mainVotingPlugin.connect(charlie).execute(pid)).to.be + // Carol cannot execute + await expect(mainVotingPlugin.connect(carol).execute(pid)).to.be .reverted; // Alice rejects @@ -773,8 +773,8 @@ describe("Main Voting Plugin", function () { ).to.not.be.reverted; expect(await mainVotingPlugin.canExecute(pid)).to.eq(false); - // Charlie cannot execute - await expect(mainVotingPlugin.connect(charlie).execute(pid)).to.be + // Carol cannot execute + await expect(mainVotingPlugin.connect(carol).execute(pid)).to.be .reverted; }); @@ -820,10 +820,10 @@ describe("Main Voting Plugin", function () { mainVotingPlugin.connect(bob).addAddresses([bob.address]), ).to.be.reverted; await expect( - mainVotingPlugin.connect(charlie).addAddresses([debbie.address]), + mainVotingPlugin.connect(carol).addAddresses([dave.address]), ).to.be.reverted; await expect( - mainVotingPlugin.connect(debbie).addAddresses([debbie.address]), + mainVotingPlugin.connect(dave).addAddresses([dave.address]), ).to.be.reverted; // The DAO can @@ -833,7 +833,7 @@ describe("Main Voting Plugin", function () { value: 0, data: MainVotingPlugin__factory.createInterface() .encodeFunctionData("addAddresses", [ - [debbie.address], + [dave.address], ]), }, ]; @@ -858,10 +858,10 @@ describe("Main Voting Plugin", function () { mainVotingPlugin.connect(bob).removeAddresses([bob.address]), ).to.be.reverted; await expect( - mainVotingPlugin.connect(charlie).removeAddresses([bob.address]), + mainVotingPlugin.connect(carol).removeAddresses([bob.address]), ).to.be.reverted; await expect( - mainVotingPlugin.connect(debbie).removeAddresses([bob.address]), + mainVotingPlugin.connect(dave).removeAddresses([bob.address]), ).to.be.reverted; // The DAO can @@ -894,13 +894,13 @@ describe("Main Voting Plugin", function () { mainVotingPlugin.connect(bob).upgradeTo(ADDRESS_ONE), ).to.be.reverted; await expect( - mainVotingPlugin.connect(charlie).upgradeToAndCall( + mainVotingPlugin.connect(carol).upgradeToAndCall( mainVotingPlugin.implementation(), // upgrade to itself EMPTY_DATA, ), ).to.be.reverted; await expect( - mainVotingPlugin.connect(debbie).upgradeToAndCall( + mainVotingPlugin.connect(dave).upgradeToAndCall( mainVotingPlugin.implementation(), // upgrade to itself EMPTY_DATA, ), diff --git a/packages/contracts/test/unit-testing/member-access-execute-condition.ts b/packages/contracts/test/unit-testing/member-access-execute-condition.ts index b546336..b553e05 100644 --- a/packages/contracts/test/unit-testing/member-access-execute-condition.ts +++ b/packages/contracts/test/unit-testing/member-access-execute-condition.ts @@ -26,12 +26,12 @@ const SOME_CONTRACT_ADDRESS = "0x" + "1234567890".repeat(4); describe("Member Access Condition", function () { let alice: SignerWithAddress; let bob: SignerWithAddress; - let charlie: SignerWithAddress; + let carol: SignerWithAddress; let dao: DAO; let memberAccessExecuteCondition: MemberAccessExecuteCondition; before(async () => { - [alice, bob, charlie] = await ethers.getSigners(); + [alice, bob, carol] = await ethers.getSigners(); dao = await deployTestDao(alice); }); @@ -51,7 +51,7 @@ describe("Member Access Condition", function () { EXECUTE_PERMISSION_ID, // permission (used) DAO__factory.createInterface().encodeFunctionData("grant", [ // call SOME_CONTRACT_ADDRESS, - charlie.address, + carol.address, MEMBER_PERMISSION_ID, ]), ), @@ -64,7 +64,7 @@ describe("Member Access Condition", function () { EXECUTE_PERMISSION_ID, // permission (used) DAO__factory.createInterface().encodeFunctionData("revoke", [ // call SOME_CONTRACT_ADDRESS, - charlie.address, + carol.address, MEMBER_PERMISSION_ID, ]), ), @@ -115,7 +115,7 @@ describe("Member Access Condition", function () { EXECUTE_PERMISSION_ID, // permission (used) DAO__factory.createInterface().encodeFunctionData("grant", [ // call SOME_CONTRACT_ADDRESS, - charlie.address, + carol.address, MEMBER_PERMISSION_ID, ]), ), @@ -127,7 +127,7 @@ describe("Member Access Condition", function () { EXECUTE_PERMISSION_ID, // permission (used) DAO__factory.createInterface().encodeFunctionData("revoke", [ // call SOME_CONTRACT_ADDRESS, - charlie.address, + carol.address, MEMBER_PERMISSION_ID, ]), ), @@ -141,7 +141,7 @@ describe("Member Access Condition", function () { EXECUTE_PERMISSION_ID, // permission (used) DAO__factory.createInterface().encodeFunctionData("grant", [ // call SOME_CONTRACT_ADDRESS, - charlie.address, + carol.address, EDITOR_PERMISSION_ID, ]), ), @@ -153,7 +153,7 @@ describe("Member Access Condition", function () { EXECUTE_PERMISSION_ID, // permission (used) DAO__factory.createInterface().encodeFunctionData("revoke", [ // call SOME_CONTRACT_ADDRESS, - charlie.address, + carol.address, EDITOR_PERMISSION_ID, ]), ), @@ -165,7 +165,7 @@ describe("Member Access Condition", function () { EXECUTE_PERMISSION_ID, // permission (used) DAO__factory.createInterface().encodeFunctionData("grant", [ // call SOME_CONTRACT_ADDRESS, - charlie.address, + carol.address, ROOT_PERMISSION_ID, ]), ), @@ -177,7 +177,7 @@ describe("Member Access Condition", function () { EXECUTE_PERMISSION_ID, // permission (used) DAO__factory.createInterface().encodeFunctionData("revoke", [ // call SOME_CONTRACT_ADDRESS, - charlie.address, + carol.address, ROOT_PERMISSION_ID, ]), ), @@ -189,7 +189,7 @@ describe("Member Access Condition", function () { EXECUTE_PERMISSION_ID, // permission (used) DAO__factory.createInterface().encodeFunctionData("grant", [ // call SOME_CONTRACT_ADDRESS, - charlie.address, + carol.address, DEPLOYER_PERMISSION_ID, ]), ), @@ -201,7 +201,7 @@ describe("Member Access Condition", function () { EXECUTE_PERMISSION_ID, // permission (used) DAO__factory.createInterface().encodeFunctionData("revoke", [ // call SOME_CONTRACT_ADDRESS, - charlie.address, + carol.address, DEPLOYER_PERMISSION_ID, ]), ), @@ -217,7 +217,7 @@ describe("Member Access Condition", function () { EXECUTE_PERMISSION_ID, // permission (used) DAO__factory.createInterface().encodeFunctionData("grant", [ // call SOME_CONTRACT_ADDRESS, - charlie.address, + carol.address, MEMBER_PERMISSION_ID, ]), ), @@ -229,7 +229,7 @@ describe("Member Access Condition", function () { EXECUTE_PERMISSION_ID, // permission (used) DAO__factory.createInterface().encodeFunctionData("revoke", [ // call SOME_CONTRACT_ADDRESS, - charlie.address, + carol.address, MEMBER_PERMISSION_ID, ]), ), @@ -243,7 +243,7 @@ describe("Member Access Condition", function () { EXECUTE_PERMISSION_ID, // permission (used) DAO__factory.createInterface().encodeFunctionData("grant", [ // call ADDRESS_TWO, - charlie.address, + carol.address, MEMBER_PERMISSION_ID, ]), ), @@ -255,7 +255,7 @@ describe("Member Access Condition", function () { EXECUTE_PERMISSION_ID, // permission (used) DAO__factory.createInterface().encodeFunctionData("revoke", [ // call ADDRESS_TWO, - charlie.address, + carol.address, MEMBER_PERMISSION_ID, ]), ), @@ -268,7 +268,7 @@ describe("Member Access Condition", function () { EXECUTE_PERMISSION_ID, // permission (used) DAO__factory.createInterface().encodeFunctionData("grant", [ // call dao.address, - charlie.address, + carol.address, MEMBER_PERMISSION_ID, ]), ), @@ -280,7 +280,7 @@ describe("Member Access Condition", function () { EXECUTE_PERMISSION_ID, // permission (used) DAO__factory.createInterface().encodeFunctionData("revoke", [ // call dao.address, - charlie.address, + carol.address, MEMBER_PERMISSION_ID, ]), ), @@ -339,7 +339,7 @@ describe("Member Access Condition", function () { ), ).to.eq(true); - // Charlie + // Carol expect( await memberAccessExecuteCondition.isGranted( ADDRESS_ONE, // where (used) @@ -347,7 +347,7 @@ describe("Member Access Condition", function () { EXECUTE_PERMISSION_ID, // permission (used) DAO__factory.createInterface().encodeFunctionData("grant", [ // call SOME_CONTRACT_ADDRESS, - charlie.address, + carol.address, MEMBER_PERMISSION_ID, ]), ), @@ -359,7 +359,7 @@ describe("Member Access Condition", function () { EXECUTE_PERMISSION_ID, // permission (used) DAO__factory.createInterface().encodeFunctionData("revoke", [ // call SOME_CONTRACT_ADDRESS, - charlie.address, + carol.address, MEMBER_PERMISSION_ID, ]), ), diff --git a/packages/contracts/test/unit-testing/member-access-plugin.ts b/packages/contracts/test/unit-testing/member-access-plugin.ts index c1d252a..0026e15 100644 --- a/packages/contracts/test/unit-testing/member-access-plugin.ts +++ b/packages/contracts/test/unit-testing/member-access-plugin.ts @@ -58,8 +58,8 @@ describe("Member Access Plugin", function () { let signers: SignerWithAddress[]; let alice: SignerWithAddress; let bob: SignerWithAddress; - let charlie: SignerWithAddress; - let debbie: SignerWithAddress; + let carol: SignerWithAddress; + let dave: SignerWithAddress; let dao: DAO; let memberAccessPlugin: MemberAccessPlugin; let mainVotingPlugin: MainVotingPlugin; @@ -68,7 +68,7 @@ describe("Member Access Plugin", function () { before(async () => { signers = await ethers.getSigners(); - [alice, bob, charlie, debbie] = signers; + [alice, bob, carol, dave] = signers; dao = await deployTestDao(alice); defaultInput = { contentUri: "ipfs://" }; @@ -172,7 +172,7 @@ describe("Member Access Plugin", function () { await expect( memberAccessPlugin.initialize(dao.address, { proposalDuration: 60 * 60 * 24 * 5, - mainVotingPlugin: charlie.address, + mainVotingPlugin: carol.address, }), ).to.be.reverted; }); @@ -182,9 +182,9 @@ describe("Member Access Plugin", function () { it("Allows any address to request membership", async () => { // Random await expect( - memberAccessPlugin.connect(charlie).proposeNewMember( + memberAccessPlugin.connect(carol).proposeNewMember( toUtf8Bytes("ipfs://1234"), - charlie.address, + carol.address, ), ).to.not.be.reverted; @@ -194,8 +194,8 @@ describe("Member Access Plugin", function () { expect(proposal.parameters.minApprovals).to.eq(1); expect(proposal.actions.length).to.eq(1); expect(proposal.failsafeActionMap).to.eq(0); - expect(await memberAccessPlugin.isMember(charlie.address)).to.eq(false); - expect(await mainVotingPlugin.isMember(charlie.address)).to.eq(false); + expect(await memberAccessPlugin.isMember(carol.address)).to.eq(false); + expect(await mainVotingPlugin.isMember(carol.address)).to.eq(false); // Member await expect( @@ -239,9 +239,9 @@ describe("Member Access Plugin", function () { }); it("Emits an event when membership is requested", async () => { - const tx = await memberAccessPlugin.connect(charlie).proposeNewMember( + const tx = await memberAccessPlugin.connect(carol).proposeNewMember( toUtf8Bytes("ipfs://2345"), - charlie.address, + carol.address, ); await expect(tx).to.emit( @@ -256,7 +256,7 @@ describe("Member Access Plugin", function () { expect(!!event).to.eq(true); expect(event!.args.proposalId).to.equal(0); - expect(event!.args.creator).to.equal(charlie.address); + expect(event!.args.creator).to.equal(carol.address); expect(event!.args.metadata).to.equal( hexlify(toUtf8Bytes("ipfs://2345")), ); @@ -266,7 +266,7 @@ describe("Member Access Plugin", function () { expect(event!.args.actions[0].data).to.equal( DAO__factory.createInterface().encodeFunctionData("grant", [ mainVotingPlugin.address, - charlie.address, + carol.address, MEMBER_PERMISSION_ID, ]), ); @@ -281,27 +281,27 @@ describe("Member Access Plugin", function () { expect(await memberAccessPlugin.isMember(alice.address)).to.eq(true); expect(await memberAccessPlugin.isMember(bob.address)).to.eq(true); - expect(await memberAccessPlugin.isMember(charlie.address)).to.eq(false); + expect(await memberAccessPlugin.isMember(carol.address)).to.eq(false); await dao.grant( mainVotingPlugin.address, - charlie.address, + carol.address, MEMBER_PERMISSION_ID, ); - expect(await memberAccessPlugin.isMember(charlie.address)).to.eq(true); + expect(await memberAccessPlugin.isMember(carol.address)).to.eq(true); await dao.revoke( mainVotingPlugin.address, - charlie.address, + carol.address, MEMBER_PERMISSION_ID, ); - expect(await memberAccessPlugin.isMember(charlie.address)).to.eq(false); + expect(await memberAccessPlugin.isMember(carol.address)).to.eq(false); - await proposeNewEditor(charlie.address); + await proposeNewEditor(carol.address); - expect(await memberAccessPlugin.isMember(charlie.address)).to.eq(true); + expect(await memberAccessPlugin.isMember(carol.address)).to.eq(true); }); it("isEditor() returns true when appropriate", async () => { @@ -311,11 +311,11 @@ describe("Member Access Plugin", function () { expect(await memberAccessPlugin.isEditor(alice.address)).to.eq(true); expect(await memberAccessPlugin.isEditor(bob.address)).to.eq(false); - expect(await memberAccessPlugin.isEditor(charlie.address)).to.eq(false); + expect(await memberAccessPlugin.isEditor(carol.address)).to.eq(false); - await proposeNewEditor(charlie.address); + await proposeNewEditor(carol.address); - expect(await memberAccessPlugin.isEditor(charlie.address)).to.eq(true); + expect(await memberAccessPlugin.isEditor(carol.address)).to.eq(true); }); }); @@ -324,13 +324,13 @@ describe("Member Access Plugin", function () { expect(await mainVotingPlugin.addresslistLength()).to.eq(1); await expect( - memberAccessPlugin.connect(charlie).proposeNewMember( + memberAccessPlugin.connect(carol).proposeNewMember( toUtf8Bytes("ipfs://1234"), - charlie.address, + carol.address, ), ).to.not.be.reverted; - expect(await memberAccessPlugin.isMember(charlie.address)).to.eq(false); + expect(await memberAccessPlugin.isMember(carol.address)).to.eq(false); // Approve it (Bob) => fail await expect( @@ -338,15 +338,15 @@ describe("Member Access Plugin", function () { ).to.be.reverted; // Still not a member - expect(await memberAccessPlugin.isMember(charlie.address)).to.eq(false); + expect(await memberAccessPlugin.isMember(carol.address)).to.eq(false); // Approve it (Alice) => success await expect( memberAccessPlugin.connect(alice).approve(0, false), ).to.not.be.reverted; - // Now Charlie is a member - expect(await memberAccessPlugin.isMember(charlie.address)).to.eq(true); + // Now Carol is a member + expect(await memberAccessPlugin.isMember(carol.address)).to.eq(true); }); it("Only the editor can reject memberships", async () => { @@ -355,23 +355,23 @@ describe("Member Access Plugin", function () { expect( await dao.hasPermission( mainVotingPlugin.address, - charlie.address, + carol.address, MEMBER_PERMISSION_ID, toUtf8Bytes(""), ), ).to.eq(false); await expect( - memberAccessPlugin.connect(charlie).proposeNewMember( + memberAccessPlugin.connect(carol).proposeNewMember( toUtf8Bytes("ipfs://1234"), - charlie.address, + carol.address, ), ).to.not.be.reverted; expect( await dao.hasPermission( mainVotingPlugin.address, - charlie.address, + carol.address, MEMBER_PERMISSION_ID, toUtf8Bytes(""), ), @@ -386,7 +386,7 @@ describe("Member Access Plugin", function () { expect( await dao.hasPermission( mainVotingPlugin.address, - charlie.address, + carol.address, MEMBER_PERMISSION_ID, toUtf8Bytes(""), ), @@ -397,11 +397,11 @@ describe("Member Access Plugin", function () { memberAccessPlugin.connect(alice).reject(0), ).to.not.be.reverted; - // Charlie is not a member + // Carol is not a member expect( await dao.hasPermission( mainVotingPlugin.address, - charlie.address, + carol.address, MEMBER_PERMISSION_ID, toUtf8Bytes(""), ), @@ -417,9 +417,9 @@ describe("Member Access Plugin", function () { expect(await mainVotingPlugin.addresslistLength()).to.eq(1); await expect( - memberAccessPlugin.connect(charlie).proposeNewMember( + memberAccessPlugin.connect(carol).proposeNewMember( toUtf8Bytes("ipfs://1234"), - charlie.address, + carol.address, ), ).to.not.be.reverted; @@ -441,9 +441,9 @@ describe("Member Access Plugin", function () { expect(await mainVotingPlugin.addresslistLength()).to.eq(1); await expect( - memberAccessPlugin.connect(charlie).proposeNewMember( + memberAccessPlugin.connect(carol).proposeNewMember( toUtf8Bytes("ipfs://1234"), - charlie.address, + carol.address, ), ).to.not.be.reverted; @@ -464,39 +464,39 @@ describe("Member Access Plugin", function () { it("Proposal execution is immediate when created by the only editor", async () => { expect(await mainVotingPlugin.addresslistLength()).to.eq(1); - expect(await memberAccessPlugin.isMember(charlie.address)).to.eq(false); + expect(await memberAccessPlugin.isMember(carol.address)).to.eq(false); // Alice proposes await expect( memberAccessPlugin.proposeNewMember( toUtf8Bytes("ipfs://1234"), - charlie.address, + carol.address, ), ).to.not.be.reverted; - // Now Charlie is a member - expect(await memberAccessPlugin.isMember(charlie.address)).to.eq(true); + // Now Carol is a member + expect(await memberAccessPlugin.isMember(carol.address)).to.eq(true); // Undo await expect( memberAccessPlugin.proposeRemoveMember( toUtf8Bytes("ipfs://1234"), - charlie.address, + carol.address, ), ).to.not.be.reverted; - // Charlie is no longer a member - expect(await memberAccessPlugin.isMember(charlie.address)).to.eq(false); + // Carol is no longer a member + expect(await memberAccessPlugin.isMember(carol.address)).to.eq(false); }); it("Proposals created by a non-editor need an editor's approval", async () => { expect(await mainVotingPlugin.addresslistLength()).to.eq(1); - expect(await memberAccessPlugin.isMember(debbie.address)).to.eq(false); + expect(await memberAccessPlugin.isMember(dave.address)).to.eq(false); await expect( - memberAccessPlugin.connect(debbie).proposeNewMember( + memberAccessPlugin.connect(dave).proposeNewMember( toUtf8Bytes("ipfs://1234"), - debbie.address, + dave.address, ), ).to.not.be.reverted; let pid = 0; @@ -505,31 +505,31 @@ describe("Member Access Plugin", function () { expect(proposal.executed).to.eq(false); expect(proposal.parameters.minApprovals).to.eq(1); expect(await memberAccessPlugin.canExecute(pid)).to.eq(false); - expect(await memberAccessPlugin.isMember(debbie.address)).to.eq(false); + expect(await memberAccessPlugin.isMember(dave.address)).to.eq(false); - // Debbie cannot - await expect(memberAccessPlugin.connect(debbie).approve(pid, false)).to + // Dave cannot + await expect(memberAccessPlugin.connect(dave).approve(pid, false)).to .be.reverted; - await expect(memberAccessPlugin.connect(debbie).execute(pid)).to + await expect(memberAccessPlugin.connect(dave).execute(pid)).to .be.reverted; - expect(await memberAccessPlugin.isMember(debbie.address)).to.eq(false); + expect(await memberAccessPlugin.isMember(dave.address)).to.eq(false); // Alice can await expect(memberAccessPlugin.connect(alice).approve(pid, false)).to .not.be.reverted; - expect(await memberAccessPlugin.isMember(debbie.address)).to.eq(true); + expect(await memberAccessPlugin.isMember(dave.address)).to.eq(true); }); }); describe("Multiple editors case", () => { // Alice: editor // Bob: editor - // Charlie: editor + // Carol: editor beforeEach(async () => { let pidMainVoting = 0; await proposeNewEditor(bob.address); - await proposeNewEditor(charlie.address); + await proposeNewEditor(carol.address); pidMainVoting = 1; await mainVotingPlugin.connect(bob).vote( pidMainVoting, @@ -541,37 +541,37 @@ describe("Member Access Plugin", function () { it("Only editors can approve new memberships", async () => { expect(await mainVotingPlugin.addresslistLength()).to.eq(3); - // Requesting membership for Debbie + // Requesting membership for Dave let pid = 0; - expect(await memberAccessPlugin.isMember(debbie.address)).to.eq(false); + expect(await memberAccessPlugin.isMember(dave.address)).to.eq(false); await expect( - memberAccessPlugin.connect(debbie).proposeNewMember( + memberAccessPlugin.connect(dave).proposeNewMember( toUtf8Bytes("ipfs://1234"), - debbie.address, + dave.address, ), ).to.not.be.reverted; - expect(await memberAccessPlugin.isMember(debbie.address)).to.eq(false); + expect(await memberAccessPlugin.isMember(dave.address)).to.eq(false); - // Debbie cannot approve (fail) + // Dave cannot approve (fail) await expect( - memberAccessPlugin.connect(debbie).approve(pid, false), + memberAccessPlugin.connect(dave).approve(pid, false), ).to.be.reverted; - // Debbie is still not a member - expect(await memberAccessPlugin.isMember(debbie.address)).to.eq(false); + // Dave is still not a member + expect(await memberAccessPlugin.isMember(dave.address)).to.eq(false); // Approve it (Alice) await expect( memberAccessPlugin.connect(alice).approve(pid, false), ).to.not.be.reverted; - // Debbie is now a member - expect(await memberAccessPlugin.isMember(debbie.address)).to.eq(true); + // Dave is now a member + expect(await memberAccessPlugin.isMember(dave.address)).to.eq(true); // Now requesting for 0x1 expect(await memberAccessPlugin.isMember(ADDRESS_ONE)).to.eq(false); await expect( - memberAccessPlugin.connect(debbie).proposeNewMember( + memberAccessPlugin.connect(dave).proposeNewMember( toUtf8Bytes("ipfs://1234"), ADDRESS_ONE, ), @@ -579,9 +579,9 @@ describe("Member Access Plugin", function () { pid++; expect(await memberAccessPlugin.isMember(ADDRESS_ONE)).to.eq(false); - // Debbie cannot approve (fail) + // Dave cannot approve (fail) await expect( - memberAccessPlugin.connect(debbie).approve(pid, false), + memberAccessPlugin.connect(dave).approve(pid, false), ).to.be.reverted; // ADDRESS_ONE is still not a member @@ -598,7 +598,7 @@ describe("Member Access Plugin", function () { // Now requesting for 0x2 expect(await memberAccessPlugin.isMember(ADDRESS_TWO)).to.eq(false); await expect( - memberAccessPlugin.connect(debbie).proposeNewMember( + memberAccessPlugin.connect(dave).proposeNewMember( toUtf8Bytes("ipfs://1234"), ADDRESS_TWO, ), @@ -606,17 +606,17 @@ describe("Member Access Plugin", function () { pid++; expect(await memberAccessPlugin.isMember(ADDRESS_TWO)).to.eq(false); - // Debbie cannot approve (fail) + // Dave cannot approve (fail) await expect( - memberAccessPlugin.connect(debbie).approve(pid, false), + memberAccessPlugin.connect(dave).approve(pid, false), ).to.be.reverted; // ADDRESS_TWO is still not a member expect(await memberAccessPlugin.isMember(ADDRESS_TWO)).to.eq(false); - // Approve it (Charlie) + // Approve it (Carol) await expect( - memberAccessPlugin.connect(charlie).approve(pid, false), + memberAccessPlugin.connect(carol).approve(pid, false), ).to.not.be.reverted; // ADDRESS_TWO is now a member @@ -627,7 +627,7 @@ describe("Member Access Plugin", function () { expect(await mainVotingPlugin.addresslistLength()).to.eq(3); await dao.grant( mainVotingPlugin.address, - debbie.address, + dave.address, MEMBER_PERMISSION_ID, ); await dao.grant( @@ -641,37 +641,37 @@ describe("Member Access Plugin", function () { MEMBER_PERMISSION_ID, ); - // Requesting membership for Debbie + // Requesting membership for Dave let pid = 0; - expect(await memberAccessPlugin.isMember(debbie.address)).to.eq(true); + expect(await memberAccessPlugin.isMember(dave.address)).to.eq(true); await expect( - memberAccessPlugin.connect(debbie).proposeRemoveMember( + memberAccessPlugin.connect(dave).proposeRemoveMember( toUtf8Bytes("ipfs://1234"), - debbie.address, + dave.address, ), ).to.not.be.reverted; - expect(await memberAccessPlugin.isMember(debbie.address)).to.eq(true); + expect(await memberAccessPlugin.isMember(dave.address)).to.eq(true); - // Debbie cannot approve (fail) + // Dave cannot approve (fail) await expect( - memberAccessPlugin.connect(debbie).approve(pid, false), + memberAccessPlugin.connect(dave).approve(pid, false), ).to.be.reverted; - // Debbie remains as a member - expect(await memberAccessPlugin.isMember(debbie.address)).to.eq(true); + // Dave remains as a member + expect(await memberAccessPlugin.isMember(dave.address)).to.eq(true); // Approve it (Alice) await expect( memberAccessPlugin.connect(alice).approve(pid, false), ).to.not.be.reverted; - // Debbie is no longer a member - expect(await memberAccessPlugin.isMember(debbie.address)).to.eq(false); + // Dave is no longer a member + expect(await memberAccessPlugin.isMember(dave.address)).to.eq(false); // Now requesting for 0x1 expect(await memberAccessPlugin.isMember(ADDRESS_ONE)).to.eq(true); await expect( - memberAccessPlugin.connect(debbie).proposeRemoveMember( + memberAccessPlugin.connect(dave).proposeRemoveMember( toUtf8Bytes("ipfs://1234"), ADDRESS_ONE, ), @@ -679,9 +679,9 @@ describe("Member Access Plugin", function () { pid++; expect(await memberAccessPlugin.isMember(ADDRESS_ONE)).to.eq(true); - // Debbie cannot approve (fail) + // Dave cannot approve (fail) await expect( - memberAccessPlugin.connect(debbie).approve(pid, false), + memberAccessPlugin.connect(dave).approve(pid, false), ).to.be.reverted; // ADDRESS_ONE remains as a member @@ -698,7 +698,7 @@ describe("Member Access Plugin", function () { // Now requesting for 0x2 expect(await memberAccessPlugin.isMember(ADDRESS_TWO)).to.eq(true); await expect( - memberAccessPlugin.connect(debbie).proposeRemoveMember( + memberAccessPlugin.connect(dave).proposeRemoveMember( toUtf8Bytes("ipfs://1234"), ADDRESS_TWO, ), @@ -706,17 +706,17 @@ describe("Member Access Plugin", function () { pid++; expect(await memberAccessPlugin.isMember(ADDRESS_TWO)).to.eq(true); - // Debbie cannot approve (fail) + // Dave cannot approve (fail) await expect( - memberAccessPlugin.connect(debbie).approve(pid, false), + memberAccessPlugin.connect(dave).approve(pid, false), ).to.be.reverted; // ADDRESS_TWO remains as a member expect(await memberAccessPlugin.isMember(ADDRESS_TWO)).to.eq(true); - // Approve it (Charlie) + // Approve it (Carol) await expect( - memberAccessPlugin.connect(charlie).approve(pid, false), + memberAccessPlugin.connect(carol).approve(pid, false), ).to.not.be.reverted; // ADDRESS_TWO is no longer a member @@ -728,9 +728,9 @@ describe("Member Access Plugin", function () { // Proposed by a random wallet await expect( - memberAccessPlugin.connect(debbie).proposeNewMember( + memberAccessPlugin.connect(dave).proposeNewMember( toUtf8Bytes("ipfs://1234"), - debbie.address, + dave.address, ), ).to.not.be.reverted; let pid = 0; @@ -739,17 +739,17 @@ describe("Member Access Plugin", function () { expect(proposal.executed).to.eq(false); expect(proposal.parameters.minApprovals).to.eq(1); expect(await memberAccessPlugin.canExecute(pid)).to.eq(false); - expect(await memberAccessPlugin.isMember(debbie.address)).to.eq(false); + expect(await memberAccessPlugin.isMember(dave.address)).to.eq(false); await dao.grant( mainVotingPlugin.address, - debbie.address, + dave.address, MEMBER_PERMISSION_ID, ).then((tx) => tx.wait()); // Proposed by a (now) member await expect( - memberAccessPlugin.connect(debbie).proposeNewMember( + memberAccessPlugin.connect(dave).proposeNewMember( toUtf8Bytes("ipfs://1234"), ADDRESS_ONE, ), @@ -780,29 +780,29 @@ describe("Member Access Plugin", function () { it("Only editors can reject new membership proposals", async () => { expect(await mainVotingPlugin.addresslistLength()).to.eq(3); - expect(await memberAccessPlugin.isMember(debbie.address)).to.eq(false); + expect(await memberAccessPlugin.isMember(dave.address)).to.eq(false); await expect( - memberAccessPlugin.connect(debbie).proposeNewMember( + memberAccessPlugin.connect(dave).proposeNewMember( toUtf8Bytes("ipfs://1234"), - debbie.address, + dave.address, ), ).to.not.be.reverted; - expect(await memberAccessPlugin.isMember(debbie.address)).to.eq(false); + expect(await memberAccessPlugin.isMember(dave.address)).to.eq(false); - // Reject it (Debbie) => fail - await expect(memberAccessPlugin.connect(debbie).reject(0)).to.be.reverted; + // Reject it (Dave) => fail + await expect(memberAccessPlugin.connect(dave).reject(0)).to.be.reverted; // Still not a member - expect(await memberAccessPlugin.isMember(debbie.address)).to.eq(false); + expect(await memberAccessPlugin.isMember(dave.address)).to.eq(false); // Reject it (Bob) => success await expect(memberAccessPlugin.connect(bob).reject(0)).to.not.be .reverted; // Still not a member - expect(await memberAccessPlugin.isMember(debbie.address)).to.eq(false); + expect(await memberAccessPlugin.isMember(dave.address)).to.eq(false); // Try to approve it (bob) => fail await expect(memberAccessPlugin.connect(bob).approve(0, false)).to.be @@ -815,33 +815,33 @@ describe("Member Access Plugin", function () { expect(await mainVotingPlugin.addresslistLength()).to.eq(3); await dao.grant( mainVotingPlugin.address, - debbie.address, + dave.address, MEMBER_PERMISSION_ID, ).then((tx) => tx.wait()); - expect(await memberAccessPlugin.isMember(debbie.address)).to.eq(true); + expect(await memberAccessPlugin.isMember(dave.address)).to.eq(true); await expect( - memberAccessPlugin.connect(debbie).proposeRemoveMember( + memberAccessPlugin.connect(dave).proposeRemoveMember( toUtf8Bytes("ipfs://1234"), - debbie.address, + dave.address, ), ).to.not.be.reverted; - expect(await memberAccessPlugin.isMember(debbie.address)).to.eq(true); + expect(await memberAccessPlugin.isMember(dave.address)).to.eq(true); - // Reject it (Debbie) => fail - await expect(memberAccessPlugin.connect(debbie).reject(0)).to.be.reverted; + // Reject it (Dave) => fail + await expect(memberAccessPlugin.connect(dave).reject(0)).to.be.reverted; // Still a member - expect(await memberAccessPlugin.isMember(debbie.address)).to.eq(true); + expect(await memberAccessPlugin.isMember(dave.address)).to.eq(true); // Reject it (Bob) => success await expect(memberAccessPlugin.connect(bob).reject(0)).to.not.be .reverted; // Still a member - expect(await memberAccessPlugin.isMember(debbie.address)).to.eq(true); + expect(await memberAccessPlugin.isMember(dave.address)).to.eq(true); // Try to approve it (bob) => fail await expect(memberAccessPlugin.connect(bob).approve(0, false)).to.be @@ -852,12 +852,12 @@ describe("Member Access Plugin", function () { it("Proposals created by a non-editor need an editor's approval", async () => { expect(await mainVotingPlugin.addresslistLength()).to.eq(3); - expect(await memberAccessPlugin.isMember(debbie.address)).to.eq(false); + expect(await memberAccessPlugin.isMember(dave.address)).to.eq(false); await expect( - memberAccessPlugin.connect(debbie).proposeNewMember( + memberAccessPlugin.connect(dave).proposeNewMember( toUtf8Bytes("ipfs://1234"), - debbie.address, + dave.address, ), ).to.not.be.reverted; let pid = 0; @@ -866,19 +866,19 @@ describe("Member Access Plugin", function () { expect(proposal.executed).to.eq(false); expect(proposal.parameters.minApprovals).to.eq(1); expect(await memberAccessPlugin.canExecute(pid)).to.eq(false); - expect(await memberAccessPlugin.isMember(debbie.address)).to.eq(false); + expect(await memberAccessPlugin.isMember(dave.address)).to.eq(false); - // Debbie cannot - await expect(memberAccessPlugin.connect(debbie).approve(pid, false)).to + // Dave cannot + await expect(memberAccessPlugin.connect(dave).approve(pid, false)).to .be.reverted; - await expect(memberAccessPlugin.connect(debbie).execute(pid)).to + await expect(memberAccessPlugin.connect(dave).execute(pid)).to .be.reverted; - expect(await memberAccessPlugin.isMember(debbie.address)).to.eq(false); + expect(await memberAccessPlugin.isMember(dave.address)).to.eq(false); // Alice can await expect(memberAccessPlugin.connect(alice).approve(pid, false)).to .not.be.reverted; - expect(await memberAccessPlugin.isMember(debbie.address)).to.eq(true); + expect(await memberAccessPlugin.isMember(dave.address)).to.eq(true); }); it("Proposals created by an editor need another editor's approval", async () => { @@ -887,7 +887,7 @@ describe("Member Access Plugin", function () { await expect( memberAccessPlugin.connect(alice).proposeNewMember( toUtf8Bytes("ipfs://1234"), - debbie.address, + dave.address, ), ).to.not.be.reverted; let pid = 0; @@ -905,7 +905,7 @@ describe("Member Access Plugin", function () { await expect( memberAccessPlugin.connect(alice).proposeNewMember( toUtf8Bytes("ipfs://1234"), - debbie.address, + dave.address, ), ).to.not.be.reverted; let pid = 0; @@ -918,9 +918,9 @@ describe("Member Access Plugin", function () { memberAccessPlugin.connect(alice).approve(pid, false), ).to.be.reverted; - // Approve it (Debbie) => fail + // Approve it (Dave) => fail await expect( - memberAccessPlugin.connect(debbie).approve(pid, false), + memberAccessPlugin.connect(dave).approve(pid, false), ).to.be.reverted; // Approve it (Bob) => succeed @@ -931,15 +931,15 @@ describe("Member Access Plugin", function () { proposal = await memberAccessPlugin.getProposal(pid); expect(proposal.executed).to.eq(true); - // Now Debbie is a member - expect(await memberAccessPlugin.isMember(debbie.address)).to.eq(true); + // Now Dave is a member + expect(await memberAccessPlugin.isMember(dave.address)).to.eq(true); // Alice proposes aremoving a member await expect( memberAccessPlugin.connect(alice).proposeRemoveMember( toUtf8Bytes("ipfs://1234"), - debbie.address, + dave.address, ), ).to.not.be.reverted; pid++; @@ -952,13 +952,13 @@ describe("Member Access Plugin", function () { memberAccessPlugin.connect(alice).approve(pid, false), ).to.be.reverted; - // Approve it (Debbie) => fail + // Approve it (Dave) => fail await expect( - memberAccessPlugin.connect(debbie).approve(pid, false), + memberAccessPlugin.connect(dave).approve(pid, false), ).to.be.reverted; // Still a member - expect(await memberAccessPlugin.isMember(debbie.address)).to.eq(true); + expect(await memberAccessPlugin.isMember(dave.address)).to.eq(true); // Approve it (Bob) => succeed await expect( @@ -968,8 +968,8 @@ describe("Member Access Plugin", function () { proposal = await memberAccessPlugin.getProposal(pid); expect(proposal.executed).to.eq(true); - // Now Debbie is a member - expect(await memberAccessPlugin.isMember(debbie.address)).to.eq(false); + // Now Dave is a member + expect(await memberAccessPlugin.isMember(dave.address)).to.eq(false); }); it("Memberships are rejected when the first non-proposer editor rejects", async () => { @@ -979,7 +979,7 @@ describe("Member Access Plugin", function () { await expect( memberAccessPlugin.connect(alice).proposeNewMember( toUtf8Bytes("ipfs://1234"), - debbie.address, + dave.address, ), ).to.not.be.reverted; let pid = 0; @@ -991,9 +991,9 @@ describe("Member Access Plugin", function () { memberAccessPlugin.connect(alice).reject(pid), ).to.be.reverted; - // Reject it (Debbie) => fail + // Reject it (Dave) => fail await expect( - memberAccessPlugin.connect(debbie).reject(pid), + memberAccessPlugin.connect(dave).reject(pid), ).to.be.reverted; // Reject it (Bob) => succeed @@ -1001,28 +1001,28 @@ describe("Member Access Plugin", function () { memberAccessPlugin.connect(bob).reject(pid), ).to.not.be.reverted; - // Reject it (Charlie) => can't anymore + // Reject it (Carol) => can't anymore await expect( - memberAccessPlugin.connect(charlie).reject(pid), + memberAccessPlugin.connect(carol).reject(pid), ).to.be.reverted; expect((await memberAccessPlugin.getProposal(pid)).executed).to.eq(false); - // Debbie is still not a member - expect(await memberAccessPlugin.isMember(debbie.address)).to.eq(false); + // Dave is still not a member + expect(await memberAccessPlugin.isMember(dave.address)).to.eq(false); // Alice proposes removing a member await dao.grant( mainVotingPlugin.address, - debbie.address, + dave.address, MEMBER_PERMISSION_ID, ).then((tx) => tx.wait()); await expect( memberAccessPlugin.connect(alice).proposeRemoveMember( toUtf8Bytes("ipfs://1234"), - debbie.address, + dave.address, ), ).to.not.be.reverted; pid++; @@ -1034,13 +1034,13 @@ describe("Member Access Plugin", function () { memberAccessPlugin.connect(alice).reject(pid), ).to.be.reverted; - // Reject it (Debbie) => fail + // Reject it (Dave) => fail await expect( - memberAccessPlugin.connect(debbie).reject(pid), + memberAccessPlugin.connect(dave).reject(pid), ).to.be.reverted; // Still a member - expect(await memberAccessPlugin.isMember(debbie.address)).to.eq(true); + expect(await memberAccessPlugin.isMember(dave.address)).to.eq(true); // Reject it (Bob) => succeed await expect( @@ -1050,17 +1050,17 @@ describe("Member Access Plugin", function () { expect((await memberAccessPlugin.getProposal(pid)).executed).to.eq(false); // Still a member - expect(await memberAccessPlugin.isMember(debbie.address)).to.eq(true); + expect(await memberAccessPlugin.isMember(dave.address)).to.eq(true); - // Reject it (Charlie) => succeed + // Reject it (Carol) => succeed await expect( - memberAccessPlugin.connect(charlie).reject(pid), + memberAccessPlugin.connect(carol).reject(pid), ).to.be.reverted; expect((await memberAccessPlugin.getProposal(pid)).executed).to.eq(false); // Still a member - expect(await memberAccessPlugin.isMember(debbie.address)).to.eq(true); + expect(await memberAccessPlugin.isMember(dave.address)).to.eq(true); }); }); @@ -1070,9 +1070,9 @@ describe("Member Access Plugin", function () { it("proposeNewMember should generate the right action list", async () => { await expect( - memberAccessPlugin.connect(charlie).proposeNewMember( + memberAccessPlugin.connect(carol).proposeNewMember( toUtf8Bytes("ipfs://1234"), - charlie.address, + carol.address, ), ).to.not.be.reverted; @@ -1083,7 +1083,7 @@ describe("Member Access Plugin", function () { expect(proposal.actions[0].data).to.eq( DAO__factory.createInterface().encodeFunctionData("grant", [ mainVotingPlugin.address, - charlie.address, + carol.address, MEMBER_PERMISSION_ID, ]), ); @@ -1112,7 +1112,7 @@ describe("Member Access Plugin", function () { it("Attempting to approve twice fails", async () => { await expect( - memberAccessPlugin.connect(debbie).proposeRemoveMember( + memberAccessPlugin.connect(dave).proposeRemoveMember( toUtf8Bytes("ipfs://1234"), bob.address, ), @@ -1125,7 +1125,7 @@ describe("Member Access Plugin", function () { it("Attempting to reject twice fails", async () => { await expect( - memberAccessPlugin.connect(debbie).proposeRemoveMember( + memberAccessPlugin.connect(dave).proposeRemoveMember( toUtf8Bytes("ipfs://1234"), bob.address, ), @@ -1138,7 +1138,7 @@ describe("Member Access Plugin", function () { it("Attempting to propose adding an existing member fails", async () => { await expect( - memberAccessPlugin.connect(charlie).proposeNewMember( + memberAccessPlugin.connect(carol).proposeNewMember( toUtf8Bytes("ipfs://1234"), alice.address, ), @@ -1161,9 +1161,9 @@ describe("Member Access Plugin", function () { it("Attempting to propose removing a non-member fails", async () => { await expect( - memberAccessPlugin.connect(charlie).proposeRemoveMember( + memberAccessPlugin.connect(carol).proposeRemoveMember( toUtf8Bytes("ipfs://1234"), - charlie.address, + carol.address, ), ).to.be.reverted; @@ -1184,7 +1184,7 @@ describe("Member Access Plugin", function () { it("Rejected proposals cannot be approved", async () => { await expect( - memberAccessPlugin.connect(debbie).proposeRemoveMember( + memberAccessPlugin.connect(dave).proposeRemoveMember( toUtf8Bytes("ipfs://1234"), bob.address, ), @@ -1197,7 +1197,7 @@ describe("Member Access Plugin", function () { it("Rejected proposals cannot be executed", async () => { await expect( - memberAccessPlugin.connect(debbie).proposeRemoveMember( + memberAccessPlugin.connect(dave).proposeRemoveMember( toUtf8Bytes("ipfs://1234"), bob.address, ), @@ -1287,13 +1287,13 @@ describe("Member Access Plugin", function () { }), ).to.be.reverted; await expect( - memberAccessPlugin.connect(charlie).updateMultisigSettings({ + memberAccessPlugin.connect(carol).updateMultisigSettings({ proposalDuration: 60 * 60 * 24 * 5, mainVotingPlugin: mainVotingPlugin.address, }), ).to.be.reverted; await expect( - memberAccessPlugin.connect(debbie).updateMultisigSettings({ + memberAccessPlugin.connect(dave).updateMultisigSettings({ proposalDuration: 60 * 60 * 24 * 5, mainVotingPlugin: mainVotingPlugin.address, }), @@ -1330,13 +1330,13 @@ describe("Member Access Plugin", function () { memberAccessPlugin.connect(bob).upgradeTo(ADDRESS_ONE), ).to.be.reverted; await expect( - memberAccessPlugin.connect(charlie).upgradeToAndCall( + memberAccessPlugin.connect(carol).upgradeToAndCall( memberAccessPlugin.implementation(), // upgrade to itself EMPTY_DATA, ), ).to.be.reverted; await expect( - memberAccessPlugin.connect(debbie).upgradeToAndCall( + memberAccessPlugin.connect(dave).upgradeToAndCall( memberAccessPlugin.implementation(), // upgrade to itself EMPTY_DATA, ), @@ -1483,7 +1483,7 @@ describe("Member Access Plugin", function () { expect(await memberAccessPlugin.proposalCount()).to.equal(0); await expect( - memberAccessPlugin.proposeNewMember(EMPTY_DATA, charlie.address), + memberAccessPlugin.proposeNewMember(EMPTY_DATA, carol.address), ).not.to.be.reverted; expect(await memberAccessPlugin.proposalCount()).to.equal(1); @@ -1491,14 +1491,14 @@ describe("Member Access Plugin", function () { it("creates unique proposal IDs for each proposal", async () => { const proposalId0 = await memberAccessPlugin.callStatic - .proposeNewMember(EMPTY_DATA, charlie.address); + .proposeNewMember(EMPTY_DATA, carol.address); // create a new proposal for the proposalCounter to be incremented await expect( - memberAccessPlugin.proposeNewMember(EMPTY_DATA, charlie.address), + memberAccessPlugin.proposeNewMember(EMPTY_DATA, carol.address), ).not.to.be.reverted; const proposalId1 = await memberAccessPlugin.callStatic - .proposeNewMember(EMPTY_DATA, debbie.address); + .proposeNewMember(EMPTY_DATA, dave.address); expect(proposalId0).to.equal(0); // To be removed when proposal ID is generated as a hash. expect(proposalId1).to.equal(1); // To be removed when proposal ID is generated as a hash. @@ -1509,7 +1509,7 @@ describe("Member Access Plugin", function () { it("emits the `ProposalCreated` event", async () => { await expect( memberAccessPlugin - .proposeNewMember(EMPTY_DATA, charlie.address), + .proposeNewMember(EMPTY_DATA, carol.address), ).to.emit(memberAccessPlugin, "ProposalCreated"); }); @@ -1541,7 +1541,7 @@ describe("Member Access Plugin", function () { ); await expect( memberAccessPlugin - .proposeNewMember(EMPTY_DATA, charlie.address), + .proposeNewMember(EMPTY_DATA, carol.address), ) .to.revertedWithCustomError( memberAccessPlugin, @@ -1561,10 +1561,10 @@ describe("Member Access Plugin", function () { expect(await memberAccessPlugin.isEditor(alice.address)).to.be.true; expect(await memberAccessPlugin.isEditor(bob.address)).to.be.true; - expect(await memberAccessPlugin.isEditor(charlie.address)).to.be.false; + expect(await memberAccessPlugin.isEditor(carol.address)).to.be.false; // Alice approves - await memberAccessPlugin.proposeNewMember(EMPTY_DATA, charlie.address); + await memberAccessPlugin.proposeNewMember(EMPTY_DATA, carol.address); id = 0; }); @@ -1599,7 +1599,7 @@ describe("Member Access Plugin", function () { }); it("returns `false` if the proposal has ended", async () => { - await memberAccessPlugin.proposeNewMember(EMPTY_DATA, charlie.address); + await memberAccessPlugin.proposeNewMember(EMPTY_DATA, carol.address); id++; expect(await memberAccessPlugin.canApprove(id, bob.address)).to @@ -1619,7 +1619,7 @@ describe("Member Access Plugin", function () { await mineBlock(); // Alice approves - await memberAccessPlugin.proposeNewMember(EMPTY_DATA, charlie.address); + await memberAccessPlugin.proposeNewMember(EMPTY_DATA, carol.address); id = 0; }); @@ -1642,7 +1642,7 @@ describe("Member Access Plugin", function () { await mineBlock(); // Alice approves - await memberAccessPlugin.proposeNewMember(EMPTY_DATA, charlie.address); + await memberAccessPlugin.proposeNewMember(EMPTY_DATA, carol.address); id = 0; }); @@ -1697,10 +1697,10 @@ describe("Member Access Plugin", function () { expect(await memberAccessPlugin.isEditor(alice.address)).to.be.true; expect(await memberAccessPlugin.isEditor(bob.address)).to.be.true; - expect(await memberAccessPlugin.isEditor(charlie.address)).to.be.false; + expect(await memberAccessPlugin.isEditor(carol.address)).to.be.false; // Alice approves - await memberAccessPlugin.proposeNewMember(EMPTY_DATA, charlie.address); + await memberAccessPlugin.proposeNewMember(EMPTY_DATA, carol.address); id = 0; }); @@ -1733,7 +1733,7 @@ describe("Member Access Plugin", function () { await mineBlock(); // Alice approves - await memberAccessPlugin.proposeNewMember(EMPTY_DATA, charlie.address); + await memberAccessPlugin.proposeNewMember(EMPTY_DATA, carol.address); id = 0; }); diff --git a/packages/contracts/test/unit-testing/personal-space-admin-plugin.ts b/packages/contracts/test/unit-testing/personal-space-admin-plugin.ts index e912b95..00dc697 100644 --- a/packages/contracts/test/unit-testing/personal-space-admin-plugin.ts +++ b/packages/contracts/test/unit-testing/personal-space-admin-plugin.ts @@ -50,7 +50,7 @@ export const psvpInterface = new ethers.utils.Interface([ describe("Personal Space Admin Plugin", function () { let alice: SignerWithAddress; let bob: SignerWithAddress; - let charlie: SignerWithAddress; + let carol: SignerWithAddress; let dao: DAO; let personalSpaceVotingPlugin: PersonalSpaceAdminPlugin; let personalSpaceVotingCloneFactory: PersonalSpaceAdminCloneFactory; @@ -60,7 +60,7 @@ describe("Personal Space Admin Plugin", function () { let dummyMetadata: string; before(async () => { - [alice, bob, charlie] = await ethers.getSigners(); + [alice, bob, carol] = await ethers.getSigners(); dao = await deployTestDao(alice); defaultInput = { contentUri: "ipfs://" }; @@ -173,17 +173,17 @@ describe("Personal Space Admin Plugin", function () { expect(await personalSpaceVotingPlugin.isEditor(alice.address)).to.eq(true); expect(await personalSpaceVotingPlugin.isEditor(bob.address)).to.eq(false); - expect(await personalSpaceVotingPlugin.isEditor(charlie.address)).to.eq( + expect(await personalSpaceVotingPlugin.isEditor(carol.address)).to.eq( false, ); await dao.grant( personalSpaceVotingPlugin.address, - charlie.address, + carol.address, EDITOR_PERMISSION_ID, ); - expect(await personalSpaceVotingPlugin.isEditor(charlie.address)).to.eq( + expect(await personalSpaceVotingPlugin.isEditor(carol.address)).to.eq( true, ); }); @@ -208,7 +208,7 @@ describe("Personal Space Admin Plugin", function () { EDITOR_PERMISSION_ID, ); await expect( - personalSpaceVotingPlugin.connect(charlie).executeProposal( + personalSpaceVotingPlugin.connect(carol).executeProposal( "0x", dummyActions, 0, @@ -221,7 +221,7 @@ describe("Personal Space Admin Plugin", function () { .withArgs( dao.address, personalSpaceVotingPlugin.address, - charlie.address, + carol.address, EDITOR_PERMISSION_ID, ); diff --git a/packages/contracts/test/unit-testing/space-plugin.ts b/packages/contracts/test/unit-testing/space-plugin.ts index e04bc1a..07a3957 100644 --- a/packages/contracts/test/unit-testing/space-plugin.ts +++ b/packages/contracts/test/unit-testing/space-plugin.ts @@ -22,13 +22,13 @@ export const defaultInitData: InitData = { describe("Space Plugin", function () { let alice: SignerWithAddress; let bob: SignerWithAddress; - let charlie: SignerWithAddress; + let carol: SignerWithAddress; let dao: DAO; let spacePlugin: SpacePlugin; let defaultInput: InitData; before(async () => { - [alice, bob, charlie] = await ethers.getSigners(); + [alice, bob, carol] = await ethers.getSigners(); dao = await deployTestDao(alice); defaultInput = { contentUri: "ipfs://" }; @@ -152,7 +152,7 @@ describe("Space Plugin", function () { spacePlugin.connect(bob).setContent(1, 2, toHex("ipfs://1234")), ).to.be.reverted; await expect( - spacePlugin.connect(charlie).setContent(1, 2, toHex("ipfs://1234")), + spacePlugin.connect(carol).setContent(1, 2, toHex("ipfs://1234")), ).to.be.reverted; // The DAO can @@ -179,7 +179,7 @@ describe("Space Plugin", function () { spacePlugin.connect(bob).acceptSubspace(ADDRESS_ONE), ).to.be.reverted; await expect( - spacePlugin.connect(charlie).acceptSubspace(ADDRESS_ONE), + spacePlugin.connect(carol).acceptSubspace(ADDRESS_ONE), ).to.be.reverted; // The DAO can @@ -206,7 +206,7 @@ describe("Space Plugin", function () { spacePlugin.connect(bob).removeSubspace(ADDRESS_ONE), ).to.be.reverted; await expect( - spacePlugin.connect(charlie).removeSubspace(ADDRESS_ONE), + spacePlugin.connect(carol).removeSubspace(ADDRESS_ONE), ).to.be.reverted; // The DAO can