From 68c1421d151b061f8edc800d52f7fd8af098ce7d Mon Sep 17 00:00:00 2001 From: Matt Curtis Date: Mon, 11 Sep 2023 10:14:29 +0100 Subject: [PATCH] hardhat: ensure token script doesn't spin when waiting --- .../testnet/layer2/001_whitelist_tokens.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/contracts/deployment_scripts/testnet/layer2/001_whitelist_tokens.ts b/contracts/deployment_scripts/testnet/layer2/001_whitelist_tokens.ts index aa9772bbd4..1b92270056 100644 --- a/contracts/deployment_scripts/testnet/layer2/001_whitelist_tokens.ts +++ b/contracts/deployment_scripts/testnet/layer2/001_whitelist_tokens.ts @@ -8,7 +8,7 @@ import { Receipt } from 'hardhat-deploy/dist/types'; */ -function sleep(ms) { +async function sleep(ms) { return new Promise((resolve) => { setTimeout(resolve, ms); }); @@ -95,8 +95,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { setTimeout(fail, 30_000) const messageBusContract = (await hre.ethers.getContractAt('MessageBus', '0x526c84529b2b8c11f57d93d3f5537aca3aecef9b')); while (await messageBusContract.callStatic.verifyMessageFinalized(messages[1]) != true) { - console.log(`Messages not stored on L2 yet, retrying...`); - sleep(1_000); + await sleep(1_000); } resolve(true); });