Skip to content

Commit 7ee8db0

Browse files
committed
fix: scripts clean up
1 parent bbd9049 commit 7ee8db0

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

packages/hardhat/scripts/utils.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,13 @@ export const sleep = (ms: number) => new Promise(resolve => setTimeout(resolve,
3434

3535
// Cleanup function to ensure automining is turned back on
3636
export async function cleanup() {
37-
const publicClient = await hre.viem.getPublicClient();
38-
await publicClient.transport.request({ method: "evm_setAutomine", params: [true] });
39-
console.log("\nCleaning up: turning automining back on...");
37+
try {
38+
const publicClient = await hre.viem.getPublicClient();
39+
await publicClient.transport.request({ method: "evm_setAutomine", params: [true] });
40+
console.log("\nCleaning up: turning automining back on...");
41+
} catch (error) {
42+
console.error("Error cleaning up:", error);
43+
}
4044
}
4145

4246
export const QUESTIONS_FOR_OO: string[] = [

0 commit comments

Comments
 (0)