@@ -57,7 +57,7 @@ abstract contract CompTimelockExecutionStrategyTest is SpaceTest {
57
57
uint256 eta = block .timestamp + 1000 ;
58
58
timelock.queueTransaction (address (timelock), 0 , "" , callData, eta);
59
59
60
- vm.warp (block . timestamp + 1000 );
60
+ vm.warp (vm. getBlockTimestamp () + 1000 );
61
61
62
62
timelock.executeTransaction (address (timelock), 0 , "" , callData, eta);
63
63
@@ -76,7 +76,7 @@ abstract contract CompTimelockExecutionStrategyTest is SpaceTest {
76
76
new bytes (0 )
77
77
);
78
78
_vote (author, proposalId, Choice.For, userVotingStrategies, voteMetadataURI);
79
- vm.warp (block . timestamp + space.maxVotingDuration ());
79
+ vm.warp (vm. getBlockTimestamp () + space.maxVotingDuration ());
80
80
81
81
vm.expectRevert (InvalidSpace.selector );
82
82
space.execute (proposalId, abi.encode (transactions));
@@ -92,7 +92,7 @@ abstract contract CompTimelockExecutionStrategyTest is SpaceTest {
92
92
new bytes (0 )
93
93
);
94
94
_vote (author, proposalId, Choice.For, userVotingStrategies, voteMetadataURI);
95
- vm.roll (block . number + space.maxVotingDuration ());
95
+ vm.roll (vm. getBlockNumber () + space.maxVotingDuration ());
96
96
97
97
vm.expectEmit (true , true , true , true );
98
98
emit TransactionQueued (transactions[0 ], block .timestamp + 1000 );
@@ -111,7 +111,7 @@ abstract contract CompTimelockExecutionStrategyTest is SpaceTest {
111
111
new bytes (0 )
112
112
);
113
113
_vote (author, proposalId, Choice.For, userVotingStrategies, voteMetadataURI);
114
- vm.roll (block . number + space.maxVotingDuration ());
114
+ vm.roll (vm. getBlockNumber () + space.maxVotingDuration ());
115
115
116
116
vm.expectRevert (DuplicateMetaTransaction.selector );
117
117
space.execute (proposalId, abi.encode (transactions));
@@ -144,7 +144,7 @@ abstract contract CompTimelockExecutionStrategyTest is SpaceTest {
144
144
_vote (author, secondProposalId, Choice.For, userVotingStrategies, voteMetadataURI);
145
145
146
146
// Move forward in time.
147
- vm.roll (block . number + space.maxVotingDuration ());
147
+ vm.roll (vm. getBlockNumber () + space.maxVotingDuration ());
148
148
149
149
// Queue the first one: it should work properly.
150
150
space.execute (firstProposalId, abi.encode (transactions));
@@ -163,7 +163,7 @@ abstract contract CompTimelockExecutionStrategyTest is SpaceTest {
163
163
Strategy (address (timelockExecutionStrategy), abi.encode (transactions)),
164
164
new bytes (0 )
165
165
);
166
- vm.roll (block . number + space.maxVotingDuration ());
166
+ vm.roll (vm. getBlockNumber () + space.maxVotingDuration ());
167
167
168
168
vm.expectRevert (abi.encodeWithSelector (InvalidProposalStatus.selector , ProposalStatus.Rejected));
169
169
space.execute (proposalId, abi.encode (transactions));
@@ -179,7 +179,7 @@ abstract contract CompTimelockExecutionStrategyTest is SpaceTest {
179
179
new bytes (0 )
180
180
);
181
181
_vote (author, proposalId, Choice.For, userVotingStrategies, voteMetadataURI);
182
- vm.roll (block . number + space.maxVotingDuration ());
182
+ vm.roll (vm. getBlockNumber () + space.maxVotingDuration ());
183
183
184
184
vm.expectEmit (true , true , true , true );
185
185
emit TransactionQueued (transactions[0 ], block .timestamp + 1000 );
@@ -206,7 +206,7 @@ abstract contract CompTimelockExecutionStrategyTest is SpaceTest {
206
206
);
207
207
_vote (author, proposalId, Choice.For, userVotingStrategies, voteMetadataURI);
208
208
_vote (author, proposalId2, Choice.For, userVotingStrategies, voteMetadataURI);
209
- vm.roll (block . number + space.maxVotingDuration ());
209
+ vm.roll (vm. getBlockNumber () + space.maxVotingDuration ());
210
210
211
211
space.execute (proposalId, abi.encode (transactions));
212
212
@@ -225,7 +225,7 @@ abstract contract CompTimelockExecutionStrategyTest is SpaceTest {
225
225
new bytes (0 )
226
226
);
227
227
_vote (author, proposalId, Choice.For, userVotingStrategies, voteMetadataURI);
228
- vm.roll (block . number + space.maxVotingDuration ());
228
+ vm.roll (vm. getBlockNumber () + space.maxVotingDuration ());
229
229
230
230
transactions[0 ] = MetaTransaction (recipient, 2 , "" , Enum.Operation.Call, 0 );
231
231
@@ -243,15 +243,15 @@ abstract contract CompTimelockExecutionStrategyTest is SpaceTest {
243
243
new bytes (0 )
244
244
);
245
245
_vote (author, proposalId, Choice.For, userVotingStrategies, voteMetadataURI);
246
- vm.roll (block . number + space.maxVotingDuration ());
246
+ vm.roll (vm. getBlockNumber () + space.maxVotingDuration ());
247
247
248
248
vm.expectEmit (true , true , true , true );
249
249
emit TransactionQueued (transactions[0 ], block .timestamp + 1000 );
250
250
space.execute (proposalId, abi.encode (transactions));
251
251
252
252
assertEq (recipient.balance, 0 );
253
253
254
- vm.warp (block . timestamp + timelockExecutionStrategy.timelockDelay ());
254
+ vm.warp (vm. getBlockTimestamp () + timelockExecutionStrategy.timelockDelay ());
255
255
timelockExecutionStrategy.executeQueuedProposal (abi.encode (transactions));
256
256
257
257
assertEq (recipient.balance, 1 );
@@ -267,11 +267,11 @@ abstract contract CompTimelockExecutionStrategyTest is SpaceTest {
267
267
new bytes (0 )
268
268
);
269
269
_vote (author, proposalId, Choice.For, userVotingStrategies, voteMetadataURI);
270
- vm.roll (block . number + space.maxVotingDuration ());
270
+ vm.roll (vm. getBlockNumber () + space.maxVotingDuration ());
271
271
272
272
space.execute (proposalId, abi.encode (transactions));
273
273
274
- vm.warp (block . timestamp + timelockExecutionStrategy.timelockDelay ());
274
+ vm.warp (vm. getBlockTimestamp () + timelockExecutionStrategy.timelockDelay ());
275
275
276
276
vm.expectRevert ("Timelock::executeTransaction: Transaction execution reverted. " );
277
277
timelockExecutionStrategy.executeQueuedProposal (abi.encode (transactions));
@@ -287,11 +287,11 @@ abstract contract CompTimelockExecutionStrategyTest is SpaceTest {
287
287
new bytes (0 )
288
288
);
289
289
_vote (author, proposalId, Choice.For, userVotingStrategies, voteMetadataURI);
290
- vm.roll (block . number + space.maxVotingDuration ());
290
+ vm.roll (vm. getBlockNumber () + space.maxVotingDuration ());
291
291
292
292
space.execute (proposalId, abi.encode (transactions));
293
293
294
- vm.warp (block . timestamp + timelockExecutionStrategy.timelockDelay ());
294
+ vm.warp (vm. getBlockTimestamp () + timelockExecutionStrategy.timelockDelay ());
295
295
transactions[0 ] = MetaTransaction (recipient, 2 , "" , Enum.Operation.Call, 0 );
296
296
297
297
vm.expectRevert (ProposalNotQueued.selector );
@@ -308,7 +308,7 @@ abstract contract CompTimelockExecutionStrategyTest is SpaceTest {
308
308
new bytes (0 )
309
309
);
310
310
_vote (author, proposalId, Choice.For, userVotingStrategies, voteMetadataURI);
311
- vm.roll (block . number + space.maxVotingDuration ());
311
+ vm.roll (vm. getBlockNumber () + space.maxVotingDuration ());
312
312
313
313
vm.expectEmit (true , true , true , true );
314
314
emit TransactionQueued (transactions[0 ], block .timestamp + 1000 );
@@ -328,7 +328,7 @@ abstract contract CompTimelockExecutionStrategyTest is SpaceTest {
328
328
new bytes (0 )
329
329
);
330
330
_vote (author, proposalId, Choice.For, userVotingStrategies, voteMetadataURI);
331
- vm.roll (block . number + space.maxVotingDuration ());
331
+ vm.roll (vm. getBlockNumber () + space.maxVotingDuration ());
332
332
333
333
vm.expectRevert (ProposalNotQueued.selector );
334
334
timelockExecutionStrategy.executeQueuedProposal (abi.encode (transactions));
@@ -344,15 +344,15 @@ abstract contract CompTimelockExecutionStrategyTest is SpaceTest {
344
344
new bytes (0 )
345
345
);
346
346
_vote (author, proposalId, Choice.For, userVotingStrategies, voteMetadataURI);
347
- vm.roll (block . number + space.maxVotingDuration ());
347
+ vm.roll (vm. getBlockNumber () + space.maxVotingDuration ());
348
348
349
349
vm.expectEmit (true , true , true , true );
350
350
emit TransactionQueued (transactions[0 ], block .timestamp + 1000 );
351
351
space.execute (proposalId, abi.encode (transactions));
352
352
353
353
assertEq (recipient.balance, 0 );
354
354
355
- vm.warp (block . timestamp + timelockExecutionStrategy.timelockDelay ());
355
+ vm.warp (vm. getBlockTimestamp () + timelockExecutionStrategy.timelockDelay ());
356
356
timelockExecutionStrategy.executeQueuedProposal (abi.encode (transactions));
357
357
358
358
vm.expectRevert (ProposalNotQueued.selector );
@@ -377,7 +377,7 @@ abstract contract CompTimelockExecutionStrategyTest is SpaceTest {
377
377
new bytes (0 )
378
378
);
379
379
_vote (author, proposalId, Choice.For, userVotingStrategies, voteMetadataURI);
380
- vm.roll (block . number + space.maxVotingDuration ());
380
+ vm.roll (vm. getBlockNumber () + space.maxVotingDuration ());
381
381
382
382
vm.expectRevert (InvalidTransaction.selector );
383
383
space.execute (proposalId, abi.encode (transactions));
@@ -393,7 +393,7 @@ abstract contract CompTimelockExecutionStrategyTest is SpaceTest {
393
393
new bytes (0 )
394
394
);
395
395
_vote (author, proposalId, Choice.For, userVotingStrategies, voteMetadataURI);
396
- vm.roll (block . number + space.maxVotingDuration ());
396
+ vm.roll (vm. getBlockNumber () + space.maxVotingDuration ());
397
397
398
398
space.execute (proposalId, abi.encode (transactions));
399
399
@@ -408,7 +408,7 @@ abstract contract CompTimelockExecutionStrategyTest is SpaceTest {
408
408
emit ProposalVetoed (keccak256 (abi.encode (transactions)));
409
409
timelockExecutionStrategy.veto (abi.encode (transactions));
410
410
411
- vm.warp (block . timestamp + timelockExecutionStrategy.timelockDelay ());
411
+ vm.warp (vm. getBlockTimestamp () + timelockExecutionStrategy.timelockDelay ());
412
412
vm.expectRevert (ProposalNotQueued.selector );
413
413
timelockExecutionStrategy.executeQueuedProposal (abi.encode (transactions));
414
414
}
@@ -423,7 +423,7 @@ abstract contract CompTimelockExecutionStrategyTest is SpaceTest {
423
423
new bytes (0 )
424
424
);
425
425
_vote (author, proposalId, Choice.For, userVotingStrategies, voteMetadataURI);
426
- vm.roll (block . number + space.maxVotingDuration ());
426
+ vm.roll (vm. getBlockNumber () + space.maxVotingDuration ());
427
427
428
428
space.execute (proposalId, abi.encode (transactions));
429
429
@@ -487,15 +487,15 @@ abstract contract CompTimelockExecutionStrategyTest is SpaceTest {
487
487
new bytes (0 )
488
488
);
489
489
_vote (author, proposalId, Choice.For, userVotingStrategies, voteMetadataURI);
490
- vm.roll (block . number + space.maxVotingDuration ());
490
+ vm.roll (vm. getBlockNumber () + space.maxVotingDuration ());
491
491
492
492
vm.expectEmit (true , true , true , true );
493
493
emit TransactionQueued (transactions[0 ], block .timestamp + 1000 );
494
494
space.execute (proposalId, abi.encode (transactions));
495
495
496
496
assertEq (erc721.ownerOf (1 ), address (timelock));
497
497
498
- vm.warp (block . timestamp + timelockExecutionStrategy.timelockDelay ());
498
+ vm.warp (vm. getBlockTimestamp () + timelockExecutionStrategy.timelockDelay ());
499
499
timelockExecutionStrategy.executeQueuedProposal (abi.encode (transactions));
500
500
501
501
assertEq (erc721.ownerOf (1 ), address (author));
0 commit comments