Browse Source

perf: remove redundant typechain dir deletion in local clean task

refactor: delete task-names.ts, write task name directly
Paul Razvan Berg 4 years ago
parent
commit
caed14d1de
3 changed files with 2 additions and 8 deletions
  1. 1 3
      tasks/accounts.ts
  2. 1 4
      tasks/clean.ts
  3. 0 1
      tasks/task-names.ts

+ 1 - 3
tasks/accounts.ts

@@ -1,9 +1,7 @@
 import { Signer } from "@ethersproject/abstract-signer";
 import { task } from "hardhat/config";
 
-import { TASK_ACCOUNTS } from "./task-names";
-
-task(TASK_ACCOUNTS, "Prints the list of accounts", async (_taskArgs, hre) => {
+task("accounts", "Prints the list of accounts", async (_taskArgs, hre) => {
   const accounts: Signer[] = await hre.ethers.getSigners();
 
   for (const account of accounts) {

+ 1 - 4
tasks/clean.ts

@@ -2,11 +2,8 @@ import fsExtra from "fs-extra";
 import { TASK_CLEAN } from "hardhat/builtin-tasks/task-names";
 import { task } from "hardhat/config";
 
-task(TASK_CLEAN, "Overrides the standard clean task", async function (_taskArgs, { config }, runSuper) {
+task(TASK_CLEAN, "Overrides the standard clean task", async function (_taskArgs, _hre, runSuper) {
   await fsExtra.remove("./coverage");
   await fsExtra.remove("./coverage.json");
-  if (config.typechain?.outDir) {
-    await fsExtra.remove(config.typechain.outDir);
-  }
   await runSuper();
 });

+ 0 - 1
tasks/task-names.ts

@@ -1 +0,0 @@
-export const TASK_ACCOUNTS: string = "accounts";