Skip to content

Commit

Permalink
Remove redundant initializers in a verifier task (#63)
Browse files Browse the repository at this point in the history
* Removed redundant initializers in verifier task

* Updated versions
  • Loading branch information
KyrylR authored Dec 11, 2023
1 parent e58c845 commit d4e2b93
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const migrate: ActionType<MigrateConfig> = async (taskArgs, env) => {
const migrateVerify: ActionType<MigrateVerifyConfig> = 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),
Expand Down
8 changes: 7 additions & 1 deletion src/verifier/Verifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -115,4 +116,9 @@ export class Verifier {
contract: contractName,
});
}

public static async initialize(hre: HardhatRuntimeEnvironment): Promise<void> {
initNetworkManager(hre);
await initReporter(hre.config.migrate);
}
}

0 comments on commit d4e2b93

Please sign in to comment.