Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

Commit 49b5848

Browse files
committed
GovernanceSim test: use constants
1 parent f868cf1 commit 49b5848

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/shared/TimeManipulation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import hre from 'hardhat';
22
import {BigNumber as BN} from 'ethers';
3+
import {POLYGON_AVERAGE_BLOCK_TIME} from './Constants';
34

45
export async function getHeadBlockNumber(): Promise<number> {
56
return BN.from(await hre.network.provider.send('eth_blockNumber', [])).toNumber();
@@ -16,8 +17,7 @@ export const increaseNextBlockTime = async (seconds: number) => {
1617
export const setNextBlockNumber = async (blockNumber: number) => {
1718
let currentBlock = await getHeadBlockNumber();
1819
for (; currentBlock < blockNumber; currentBlock++) {
19-
// polygon has a block time of 2.2 seconds
20-
await hre.network.provider.send('evm_increaseTime', [2]);
20+
await hre.network.provider.send('evm_increaseTime', [Math.round(POLYGON_AVERAGE_BLOCK_TIME)]);
2121
await hre.network.provider.send('evm_mine', []);
2222
}
2323
};

0 commit comments

Comments
 (0)