@@ -66,6 +66,7 @@ describe('RootDAO Contact', () => {
66
66
const getState = async ( ) => await governor . state ( proposalId )
67
67
68
68
const defaultDescription = 'transfer money to acc2 address'
69
+ const otherDesc = 'test success case'
69
70
const generateDescriptionHash = ( proposalDesc ?: string ) =>
70
71
solidityPackedKeccak256 ( [ 'string' ] , [ proposalDesc ?? defaultDescription ] )
71
72
@@ -246,18 +247,15 @@ describe('RootDAO Contact', () => {
246
247
} )
247
248
248
249
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 )
250
251
251
252
await mine ( ( await governor . votingDelay ( ) ) + 1n )
252
253
253
254
proposalSnapshot = await governor . proposalSnapshot ( proposalId )
254
255
const quorum = await governor . quorum ( proposalSnapshot )
255
256
256
- let combinedVotingPower : bigint = 0n
257
-
258
257
for ( let holder of holders . slice ( 2 , holders . length ) ) {
259
258
if ( ( await checkVotes ( ) ) <= quorum ) {
260
- combinedVotingPower += await stRIF . getVotes ( holder )
261
259
await governor . connect ( holder ) . castVote ( proposalId , 1 )
262
260
}
263
261
}
@@ -266,6 +264,15 @@ describe('RootDAO Contact', () => {
266
264
267
265
expect ( await getState ( ) ) . to . be . equal ( ProposalState . Succeeded )
268
266
} )
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
+ } )
269
276
} )
270
277
} )
271
278
} )
0 commit comments