Skip to content

Commit

Permalink
Removed redundant Hardhat Runtime Extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
KyrylR committed Dec 21, 2023
1 parent 7649e42 commit 9c72bc5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 22 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Version 2.0.0-beta.1

* Removed redundant Hardhat Runtime Extensions.
* Removed Verifier from Migrator class.
* Revised the test infrastructure and architecture.
* Fixed bugs related to the recovery of contract names.
* Fixed a bug related to contract recovery when a custom name is used.
Expand Down
13 changes: 2 additions & 11 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import "@nomicfoundation/hardhat-verify";

import { ActionType } from "hardhat/types";
import { lazyObject } from "hardhat/plugins";
import { TASK_CLEAN, TASK_COMPILE } from "hardhat/builtin-tasks/task-names";
import { extendConfig, extendEnvironment, task, types } from "hardhat/config";
import { extendConfig, task, types } from "hardhat/config";

import "./type-extensions";

Expand All @@ -12,7 +11,7 @@ import { TASK_MIGRATE, TASK_MIGRATE_VERIFY } from "./constants";

import { MigrateConfig, MigrateVerifyConfig } from "./types/migrations";

import { UserStorage, DefaultStorage } from "./tools/storage/MigrateStorage";
import { DefaultStorage } from "./tools/storage/MigrateStorage";
import { VerificationProcessor } from "./tools/storage/VerificationProcessor";

import { Migrator } from "./migrator/Migrator";
Expand Down Expand Up @@ -52,14 +51,6 @@ const migrateVerify: ActionType<MigrateVerifyConfig> = async (taskArgs, env) =>
);
};

extendEnvironment((hre) => {
hre.migrator = lazyObject(() => {
return new Migrator(hre);
});

hre.storage = lazyObject(() => UserStorage);
});

task(TASK_CLEAN, "Clears the cache and deletes all artifacts").setAction(async (conf, hre, runSuper) => {
DefaultStorage.clean();

Expand Down
11 changes: 0 additions & 11 deletions src/type-extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@ import "ethers";
import "hardhat/types/config";
import "hardhat/types/runtime";

import { Migrator } from "./migrator/Migrator";

import { MigrateConfig } from "./types/migrations";

import { MigrateStorage } from "./tools/storage/MigrateStorage";

declare module "hardhat/types/config" {
interface HardhatConfig {
migrate: MigrateConfig;
Expand All @@ -18,13 +14,6 @@ declare module "hardhat/types/config" {
}
}

declare module "hardhat/types/runtime" {
export interface HardhatRuntimeEnvironment {
migrator: Migrator;
storage: MigrateStorage;
}
}

declare module "ethers" {
interface ContractTransaction {
customData: any & { txName?: string };
Expand Down

0 comments on commit 9c72bc5

Please sign in to comment.