Skip to content

Commit 92b2f33

Browse files
test: after a proposal succeded it should be queued for execution(not finished)
1 parent 831d805 commit 92b2f33

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

test/Governor.test.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ describe('RootDAO Contact', () => {
6666
const getState = async () => await governor.state(proposalId)
6767

6868
const defaultDescription = 'transfer money to acc2 address'
69+
const otherDesc = 'test success case'
6970
const generateDescriptionHash = (proposalDesc?: string) =>
7071
solidityPackedKeccak256(['string'], [proposalDesc ?? defaultDescription])
7172

@@ -246,18 +247,15 @@ describe('RootDAO Contact', () => {
246247
})
247248

248249
it('when proposal reach quorum and votingPeriod is reached proposal state should become ProposalState.Succeeded', async () => {
249-
await createProposal('test success case')
250+
await createProposal(otherDesc)
250251

251252
await mine((await governor.votingDelay()) + 1n)
252253

253254
proposalSnapshot = await governor.proposalSnapshot(proposalId)
254255
const quorum = await governor.quorum(proposalSnapshot)
255256

256-
let combinedVotingPower: bigint = 0n
257-
258257
for (let holder of holders.slice(2, holders.length)) {
259258
if ((await checkVotes()) <= quorum) {
260-
combinedVotingPower += await stRIF.getVotes(holder)
261259
await governor.connect(holder).castVote(proposalId, 1)
262260
}
263261
}
@@ -266,6 +264,15 @@ describe('RootDAO Contact', () => {
266264

267265
expect(await getState()).to.be.equal(ProposalState.Succeeded)
268266
})
267+
268+
it('after a proposal succeded it should be queued for execution', async () => {
269+
const tx = await governor
270+
.connect(deployer)
271+
[
272+
'execute(address[],uint256[],bytes[],bytes32)'
273+
](proposal[0], proposal[1], proposal[2], generateDescriptionHash(otherDesc))
274+
await tx.wait()
275+
})
269276
})
270277
})
271278
})

0 commit comments

Comments
 (0)