Skip to content

Commit

Permalink
hardhat: ensure token script doesn't spin when waiting (#1508)
Browse files Browse the repository at this point in the history
  • Loading branch information
BedrockSquirrel authored Sep 11, 2023
1 parent 61a90b0 commit 4ddbf93
Showing 1 changed file with 2 additions and 2 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 @@ -96,7 +96,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
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 4ddbf93

Please sign in to comment.