Skip to content

Commit

Permalink
hardhat: ensure token script doesn't spin when waiting
Browse files Browse the repository at this point in the history
  • Loading branch information
BedrockSquirrel committed Sep 11, 2023
1 parent 61a90b0 commit 68c1421
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down Expand Up @@ -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);
});
Expand Down

0 comments on commit 68c1421

Please sign in to comment.