Skip to content

Commit

Permalink
test: Adjusted helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
0xJurassicPunk committed Mar 24, 2022
1 parent afbf02c commit 5fb7ab2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/helpers/block-traveller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,17 @@ export async function increaseTo(targetTime: BigNumber): Promise<void> {
export async function latest(): Promise<number> {
return (await ethers.provider.getBlock(await ethers.provider.getBlockNumber())).timestamp;
}

/**
* Start automine
*/
export async function pauseAutomine(): Promise<void> {
await network.provider.send("evm_setAutomine", [false]);
}

/**
* Resume automine
*/
export async function resumeAutomine(): Promise<void> {
await network.provider.send("evm_setAutomine", [true]);
}

0 comments on commit 5fb7ab2

Please sign in to comment.