diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d88d1b..f1c53d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Version 2.0.0-alpha.20 + +* Remove redundant initializers in a verifier task + ## Version 2.0.0-alpha.19 * Handle the potentially undefined tx.customData.txName field diff --git a/package.json b/package.json index d6f5da4..13e9b4e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@solarity/hardhat-migrate", - "version": "2.0.0-alpha.19", + "version": "2.0.0-alpha.20", "description": "Automatic deployment and verification of smart contracts", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", diff --git a/src/index.ts b/src/index.ts index 5f411f8..0e3eb0c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -45,7 +45,7 @@ const migrate: ActionType = async (taskArgs, env) => { const migrateVerify: ActionType = async (taskArgs, env) => { const config = extendVerifyConfigs(taskArgs); - await Migrator.initialize(env); + await Verifier.initialize(env); await new Verifier(env, config).verifyBatch( VerificationProcessor.restoreSavedVerificationFunctions(config.inputFile), diff --git a/src/verifier/Verifier.ts b/src/verifier/Verifier.ts index 1986b5a..7539654 100644 --- a/src/verifier/Verifier.ts +++ b/src/verifier/Verifier.ts @@ -9,7 +9,8 @@ import { Args } from "../types/deployer"; import { VerifyConfig } from "../types/migrations"; import { VerifierArgs } from "../types/verifier"; -import { reporter } from "../tools/reporters/Reporter"; +import { initReporter, reporter } from "../tools/reporters/Reporter"; +import { initNetworkManager } from "../tools/network/NetworkManager"; export class Verifier { private readonly _etherscanConfig: EtherscanConfig; @@ -115,4 +116,9 @@ export class Verifier { contract: contractName, }); } + + public static async initialize(hre: HardhatRuntimeEnvironment): Promise { + initNetworkManager(hre); + await initReporter(hre.config.migrate); + } }