Skip to content

Commit

Permalink
fix: support hardhat_reset (#667)
Browse files Browse the repository at this point in the history
Co-authored-by: Andres Adjimann <[email protected]>
  • Loading branch information
adjisb and a-d-j-i authored Jan 14, 2022
1 parent cdab28c commit b437cbf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugins/hardhat.plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const path = require('path');

const { task, types } = require("hardhat/config");
const { HardhatPluginError } = require("hardhat/plugins")

const {HARDHAT_NETWORK_RESET_EVENT} = require("hardhat/internal/constants");
const {
TASK_TEST,
TASK_COMPILE,
Expand Down Expand Up @@ -168,6 +168,9 @@ task("coverage", "Generates a code coverage report for tests")
accounts = await utils.getAccountsHardhat(network.provider);
nodeInfo = await utils.getNodeInfoHardhat(network.provider);

network.provider.on(HARDHAT_NETWORK_RESET_EVENT, () => {
api.attachToHardhatVM(network.provider);
});
api.attachToHardhatVM(network.provider);

ui.report('hardhat-network', [
Expand Down

0 comments on commit b437cbf

Please sign in to comment.