Skip to content

Commit

Permalink
revert: renaming to help github tracking the changes
Browse files Browse the repository at this point in the history
  • Loading branch information
heueristik committed Apr 2, 2024
1 parent 2ba04d6 commit fa8a8f0
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ describe('TokenVoting', function () {
const {dao, initializedPlugin, defaultVotingSettings, token} =
await loadFixture(globalFixture);

//
await expect(
initializedPlugin.initialize(
dao.address,
Expand All @@ -220,6 +221,8 @@ describe('TokenVoting', function () {
it('emits the `MembershipContractAnnounced` event', async () => {
const {dao, uninitializedPlugin, defaultVotingSettings, token} =
await loadFixture(globalFixture);

// Try to reinitialize the initialized plugin.
await expect(
await uninitializedPlugin.initialize(
dao.address,
Expand All @@ -235,31 +238,67 @@ describe('TokenVoting', function () {
});

it('sets the voting settings', async () => {
const {initializedPlugin, defaultVotingSettings} = await loadFixture(
globalFixture
const {
dao,
uninitializedPlugin: plugin,
defaultVotingSettings,
token,
} = await loadFixture(globalFixture);

// Check that the uninitialized plugin hasn't voting settings set yet.
expect(await plugin.minDuration()).to.equal(0);
expect(await plugin.minParticipation()).to.equal(0);
expect(await plugin.minProposerVotingPower()).to.equal(0);
expect(await plugin.supportThreshold()).to.equal(0);
expect(await plugin.votingMode()).to.equal(0);

// Initialize the plugin.
await plugin.initialize(
dao.address,
defaultVotingSettings,
token.address
);

expect(await initializedPlugin.minDuration()).to.equal(
// Check that the voting settings have been set.
expect(await plugin.minDuration()).to.equal(
defaultVotingSettings.minDuration
);
expect(await initializedPlugin.minParticipation()).to.equal(
expect(await plugin.minParticipation()).to.equal(
defaultVotingSettings.minParticipation
);
expect(await initializedPlugin.minProposerVotingPower()).to.equal(
expect(await plugin.minProposerVotingPower()).to.equal(
defaultVotingSettings.minProposerVotingPower
);
expect(await initializedPlugin.supportThreshold()).to.equal(
expect(await plugin.supportThreshold()).to.equal(
defaultVotingSettings.supportThreshold
);
expect(await initializedPlugin.votingMode()).to.equal(
expect(await plugin.votingMode()).to.equal(
defaultVotingSettings.votingMode
);
});

it('sets the token', async () => {
const {initializedPlugin, token} = await loadFixture(globalFixture);
const {
dao,
uninitializedPlugin: plugin,
defaultVotingSettings,
token,
} = await loadFixture(globalFixture);

// Check that the uninitialized plugin has not token set.
expect(await plugin.getVotingToken()).to.equal(
ethers.constants.AddressZero
);

// Initialize the plugin.
await plugin.initialize(
dao.address,
defaultVotingSettings,
token.address
);

expect(await initializedPlugin.getVotingToken()).to.equal(token.address);
// Check that the token has been set.
expect(await plugin.getVotingToken()).to.equal(token.address);
});
});

Expand Down

0 comments on commit fa8a8f0

Please sign in to comment.