mirror of
https://github.com/luxfhe/example-ticketing.git
synced 2026-10-30 18:13:12 +00:00
13 lines
424 B
TypeScript
13 lines
424 B
TypeScript
import { HardhatRuntimeEnvironment } from "hardhat/types";
|
|
|
|
export function delay(ms: number) {
|
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
}
|
|
|
|
export async function waitForBlock(hre: HardhatRuntimeEnvironment, current?: number) {
|
|
const targetBlock = current || (await hre.ethers.provider.getBlockNumber());
|
|
while ((await hre.ethers.provider.getBlockNumber()) <= targetBlock) {
|
|
await delay(50);
|
|
}
|
|
}
|