diff --git a/packages/hardhat-plugin-ethers/src/ethers-ignition-helper.ts b/packages/hardhat-plugin-ethers/src/ethers-ignition-helper.ts index 944ee05be..fef38dfc2 100644 --- a/packages/hardhat-plugin-ethers/src/ethers-ignition-helper.ts +++ b/packages/hardhat-plugin-ethers/src/ethers-ignition-helper.ts @@ -1,5 +1,6 @@ import { HardhatArtifactResolver, + PrettyEventHandler, errorDeploymentResultToExceptionMessage, resolveDeploymentId, } from "@nomicfoundation/hardhat-ignition/helpers"; @@ -78,6 +79,7 @@ export class EthersIgnitionHelper { strategy, strategyConfig, deploymentId: givenDeploymentId = undefined, + displayUi = false, }: { parameters?: DeploymentParameters; config?: Partial; @@ -85,6 +87,7 @@ export class EthersIgnitionHelper { strategy?: StrategyT; strategyConfig?: StrategyConfig[StrategyT]; deploymentId?: string; + displayUi?: boolean; } = { parameters: {}, config: {}, @@ -92,6 +95,7 @@ export class EthersIgnitionHelper { strategy: undefined, strategyConfig: undefined, deploymentId: undefined, + displayUi: undefined, } ): Promise< IgnitionModuleResultsTToEthersContracts< @@ -134,10 +138,15 @@ export class EthersIgnitionHelper { deploymentId ); + const executionEventListener = displayUi + ? new PrettyEventHandler() + : undefined; + const result = await deploy({ config: resolvedConfig, provider: this._provider, deploymentDir, + executionEventListener, artifactResolver, ignitionModule, deploymentParameters: parameters, diff --git a/packages/hardhat-plugin-viem/src/viem-ignition-helper.ts b/packages/hardhat-plugin-viem/src/viem-ignition-helper.ts index 52c492aa1..239243381 100644 --- a/packages/hardhat-plugin-viem/src/viem-ignition-helper.ts +++ b/packages/hardhat-plugin-viem/src/viem-ignition-helper.ts @@ -2,6 +2,7 @@ import type { GetContractReturnType } from "@nomicfoundation/hardhat-viem/types" import { HardhatArtifactResolver, + PrettyEventHandler, errorDeploymentResultToExceptionMessage, resolveDeploymentId, } from "@nomicfoundation/hardhat-ignition/helpers"; @@ -71,6 +72,7 @@ export class ViemIgnitionHelper { strategy, strategyConfig, deploymentId: givenDeploymentId = undefined, + displayUi = false, }: { parameters?: DeploymentParameters; config?: Partial; @@ -78,6 +80,7 @@ export class ViemIgnitionHelper { strategy?: StrategyT; strategyConfig?: StrategyConfig[StrategyT]; deploymentId?: string; + displayUi?: boolean; } = { parameters: {}, config: {}, @@ -85,6 +88,7 @@ export class ViemIgnitionHelper { strategy: undefined, strategyConfig: undefined, deploymentId: undefined, + displayUi: undefined, } ): Promise< IgnitionModuleResultsToViemContracts @@ -124,10 +128,15 @@ export class ViemIgnitionHelper { deploymentId ); + const executionEventListener = displayUi + ? new PrettyEventHandler() + : undefined; + const result = await deploy({ config: resolvedConfig, provider: this._provider, deploymentDir, + executionEventListener, artifactResolver, ignitionModule, deploymentParameters: parameters, diff --git a/packages/hardhat-plugin/src/helpers.ts b/packages/hardhat-plugin/src/helpers.ts index 459acc79e..019c0e688 100644 --- a/packages/hardhat-plugin/src/helpers.ts +++ b/packages/hardhat-plugin/src/helpers.ts @@ -1,3 +1,4 @@ export { HardhatArtifactResolver } from "./hardhat-artifact-resolver"; export { errorDeploymentResultToExceptionMessage } from "./utils/error-deployment-result-to-exception-message"; export { resolveDeploymentId } from "./utils/resolve-deployment-id"; +export { PrettyEventHandler } from "./ui/pretty-event-handler";