Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant initializers in a verifier task #63

Merged
merged 3 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}
}