Skip to content

Commit

Permalink
make return type optional
Browse files Browse the repository at this point in the history
  • Loading branch information
holic committed Sep 20, 2024
1 parent becbe49 commit b009443
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/cli/src/runDeploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export async function runDeploy(opts: DeployOptions): Promise<WorldDeploy> {
}

// Reset mining mode after deploy
await resetMiningMode();
await resetMiningMode?.();

console.log(chalk.green("Deployment completed in", (Date.now() - startTime) / 1000, "seconds"));

Expand Down
6 changes: 2 additions & 4 deletions packages/cli/src/utils/enableAutomine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@ type MiningMode =
blockTime: number;
};

export type EnableAutomineResult = () => Promise<void>;
export type EnableAutomineResult = undefined | (() => Promise<void>);

export async function enableAutomine(client: Client): Promise<EnableAutomineResult> {
const miningMode = await getMiningMode(client).catch(() => undefined);
// doesn't support automine or is already in automine
if (!miningMode || miningMode.type === "automine") {
return async () => {};
}
if (!miningMode || miningMode.type === "automine") return;

debug("Enabling automine");
await setMiningMode(client, { type: "automine" });
Expand Down

0 comments on commit b009443

Please sign in to comment.