Skip to content

Commit

Permalink
fix: ledger display
Browse files Browse the repository at this point in the history
  • Loading branch information
kanej committed May 1, 2024
1 parent 5ea6753 commit 8a83517
Showing 1 changed file with 25 additions and 18 deletions.
43 changes: 25 additions & 18 deletions packages/hardhat-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,34 +258,44 @@ ignitionScope
const strategyConfig = hre.config.ignition.strategyConfig?.[strategyName];

try {
const ledgerConnectionStart = () =>
executionEventListener.ledgerConnectionStart();
const ledgerConnectionSuccess = () =>
executionEventListener.ledgerConnectionSuccess();
const ledgerConnectionFailure = () =>
executionEventListener.ledgerConnectionFailure();
const ledgerConfirmationStart = () =>
executionEventListener.ledgerConfirmationStart();
const ledgerConfirmationSuccess = () =>
executionEventListener.ledgerConfirmationSuccess();
const ledgerConfirmationFailure = () =>
executionEventListener.ledgerConfirmationFailure();

try {
await hre.network.provider.send("hardhat_setLedgerOutputEnabled", [
false,
]);

hre.network.provider.once(
"connection_start",
executionEventListener.ledgerConnectionStart
);
hre.network.provider.once("connection_start", ledgerConnectionStart);
hre.network.provider.once(
"connection_success",
executionEventListener.ledgerConnectionSuccess
ledgerConnectionSuccess
);
hre.network.provider.once(
"connection_failure",
executionEventListener.ledgerConnectionFailure
ledgerConnectionFailure
);
hre.network.provider.on(
"confirmation_start",
executionEventListener.ledgerConfirmationStart
ledgerConfirmationStart
);
hre.network.provider.on(
"confirmation_success",
executionEventListener.ledgerConfirmationSuccess
ledgerConfirmationSuccess
);
hre.network.provider.on(
"confirmation_failure",
executionEventListener.ledgerConfirmationFailure
ledgerConfirmationFailure
);
} catch {}

Expand Down Expand Up @@ -313,29 +323,26 @@ ignitionScope
true,
]);

hre.network.provider.off(
"connection_start",
executionEventListener.ledgerConnectionStart
);
hre.network.provider.off("connection_start", ledgerConnectionStart);
hre.network.provider.off(
"connection_success",
executionEventListener.ledgerConnectionSuccess
ledgerConnectionSuccess
);
hre.network.provider.off(
"connection_failure",
executionEventListener.ledgerConnectionFailure
ledgerConnectionFailure
);
hre.network.provider.off(
"confirmation_start",
executionEventListener.ledgerConfirmationStart
ledgerConfirmationStart
);
hre.network.provider.off(
"confirmation_success",
executionEventListener.ledgerConfirmationSuccess
ledgerConfirmationSuccess
);
hre.network.provider.off(
"confirmation_failure",
executionEventListener.ledgerConfirmationFailure
ledgerConfirmationFailure
);
} catch {}

Expand Down

0 comments on commit 8a83517

Please sign in to comment.