Skip to content

Commit

Permalink
condition reorder
Browse files Browse the repository at this point in the history
  • Loading branch information
novaknole committed Oct 25, 2024
1 parent a857d9e commit 8e9b423
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions packages/contracts/src/TokenVotingSetup.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
Expand Down Expand Up @@ -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()
);

Expand Down
6 changes: 3 additions & 3 deletions packages/contracts/test/10_unit-testing/12_plugin-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down Expand Up @@ -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([
Expand Down Expand Up @@ -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([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -272,7 +272,7 @@ describe(`PluginSetup processing on network '${productionNetworkName}'`, functio
),
[]
),
[pluginToken, condition]
[condition, pluginToken]
);
});

Expand Down Expand Up @@ -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(
Expand All @@ -359,7 +359,7 @@ describe(`PluginSetup processing on network '${productionNetworkName}'`, functio
),
[]
),
[pluginToken, condition]
[condition, pluginToken]
);
});

Expand Down

0 comments on commit 8e9b423

Please sign in to comment.