From 8e9b423cdbcee02718edb3d8b48a54fc3f2f2db6 Mon Sep 17 00:00:00 2001 From: Giorgi Lagidze Date: Fri, 25 Oct 2024 15:02:08 +0400 Subject: [PATCH] condition reorder --- packages/contracts/src/TokenVotingSetup.sol | 6 +++--- .../contracts/test/10_unit-testing/12_plugin-setup.ts | 6 +++--- .../test/20_integration-testing/22_setup-processing.ts | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/contracts/src/TokenVotingSetup.sol b/packages/contracts/src/TokenVotingSetup.sol index 2484ab83..ef6dcab3 100644 --- a/packages/contracts/src/TokenVotingSetup.sol +++ b/packages/contracts/src/TokenVotingSetup.sol @@ -169,8 +169,8 @@ contract TokenVotingSetup is PluginUpgradeableSetup { ); preparedSetupData.helpers = new address[](2); - preparedSetupData.helpers[0] = token; - preparedSetupData.helpers[1] = address(new VotingPowerCondition(plugin)); + preparedSetupData.helpers[0] = address(new VotingPowerCondition(plugin)); + preparedSetupData.helpers[1] = token; // Prepare permissions PermissionLib.MultiTargetPermission[] @@ -201,7 +201,7 @@ contract TokenVotingSetup is PluginUpgradeableSetup { PermissionLib.Operation.GrantWithCondition, plugin, address(type(uint160).max), // ANY_ADDR - preparedSetupData.helpers[1], // VotingPowerCondition + preparedSetupData.helpers[0], // VotingPowerCondition TokenVoting(IMPLEMENTATION).CREATE_PROPOSAL_PERMISSION_ID() ); diff --git a/packages/contracts/test/10_unit-testing/12_plugin-setup.ts b/packages/contracts/test/10_unit-testing/12_plugin-setup.ts index 37f5f93d..f0e19069 100644 --- a/packages/contracts/test/10_unit-testing/12_plugin-setup.ts +++ b/packages/contracts/test/10_unit-testing/12_plugin-setup.ts @@ -397,8 +397,8 @@ describe('TokenVotingSetup', function () { expect(plugin).to.be.equal(anticipatedPluginAddress); expect(helpers.length).to.be.equal(2); expect(helpers).to.be.deep.equal([ - anticipatedWrappedTokenAddress, anticipatedCondition, + anticipatedWrappedTokenAddress, ]); expect(permissions.length).to.be.equal(5); expect(permissions).to.deep.equal([ @@ -577,8 +577,8 @@ describe('TokenVotingSetup', function () { expect(plugin).to.be.equal(anticipatedPluginAddress); expect(helpers.length).to.be.equal(2); expect(helpers).to.be.deep.equal([ - governanceERC20.address, anticipatedCondition, + governanceERC20.address, ]); expect(permissions.length).to.be.equal(5); expect(permissions).to.deep.equal([ @@ -661,8 +661,8 @@ describe('TokenVotingSetup', function () { expect(plugin).to.be.equal(anticipatedPluginAddress); expect(helpers.length).to.be.equal(2); expect(helpers).to.be.deep.equal([ - anticipatedTokenAddress, anticipatedCondition, + anticipatedTokenAddress, ]); expect(permissions.length).to.be.equal(6); expect(permissions).to.deep.equal([ diff --git a/packages/contracts/test/20_integration-testing/22_setup-processing.ts b/packages/contracts/test/20_integration-testing/22_setup-processing.ts index 8f0f14cf..a87295c0 100644 --- a/packages/contracts/test/20_integration-testing/22_setup-processing.ts +++ b/packages/contracts/test/20_integration-testing/22_setup-processing.ts @@ -257,7 +257,7 @@ describe(`PluginSetup processing on network '${productionNetworkName}'`, functio expect(await plugin.isMember(alice.address)).to.be.false; expect(await plugin.isMember(deployer.address)).to.be.true; - const condition = results.preparedEvent.args.preparedSetupData.helpers[1]; + const condition = results.preparedEvent.args.preparedSetupData.helpers[0]; // Uninstall the current build. await uninstallPLugin( @@ -272,7 +272,7 @@ describe(`PluginSetup processing on network '${productionNetworkName}'`, functio ), [] ), - [pluginToken, condition] + [condition, pluginToken] ); }); @@ -344,7 +344,7 @@ describe(`PluginSetup processing on network '${productionNetworkName}'`, functio expect(await plugin.isMember(alice.address)).to.be.true; expect(await plugin.isMember(deployer.address)).to.be.false; - const condition = results.preparedEvent.args.preparedSetupData.helpers[1]; + const condition = results.preparedEvent.args.preparedSetupData.helpers[0]; // Uninstall the current build. await uninstallPLugin( @@ -359,7 +359,7 @@ describe(`PluginSetup processing on network '${productionNetworkName}'`, functio ), [] ), - [pluginToken, condition] + [condition, pluginToken] ); });