Skip to content

Commit

Permalink
chore: apply prettier styling changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kanej committed Feb 5, 2025
1 parent c1acdc6 commit 1679340
Show file tree
Hide file tree
Showing 29 changed files with 112 additions and 151 deletions.
7 changes: 3 additions & 4 deletions v-next/hardhat-ignition/src/hardhat-artifact-resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import path from "node:path";

import { HardhatError } from "@ignored/hardhat-vnext-errors";


export class HardhatArtifactResolver implements ArtifactResolver {
constructor(private readonly _hre: HardhatRuntimeEnvironment) {}

Expand All @@ -35,9 +34,9 @@ export class HardhatArtifactResolver implements ArtifactResolver {
throw new HardhatError(
HardhatError.ERRORS.IGNITION.ARTIFACT_PATH_NOT_FOUND,
{
contractName
}
)
contractName,
},
);
}

const debugPath = artifactPath.replace(".json", ".dbg.json");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type { UiState } from "../types.js";
import { assertHardhatInvariant } from "@ignored/hardhat-vnext-errors";
import chalk from "chalk";


import { pathFromCwd } from "./cwd-relative-path.js";

export function calculateDeployingModulePanel(state: UiState): string {
Expand All @@ -12,7 +11,10 @@ export function calculateDeployingModulePanel(state: UiState): string {
`;

if (state.isResumed === true) {
assertHardhatInvariant(state.deploymentDir !== null && state.deploymentDir !== undefined, "Deployment dir is undefined");
assertHardhatInvariant(
state.deploymentDir !== null && state.deploymentDir !== undefined,
"Deployment dir is undefined",
);
deployingMessage += `${chalk.bold(
`Resuming existing deployment from ${pathFromCwd(state.deploymentDir)}`,
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ import type {
PreviousRunErrorDeploymentResult,
ReconciliationErrorDeploymentResult,
SuccessfulDeploymentResult,
ValidationErrorDeploymentResult} from "@ignored/hardhat-vnext-ignition-core";

import {
DeploymentResultType
ValidationErrorDeploymentResult,
} from "@ignored/hardhat-vnext-ignition-core";
import chalk from "chalk";

import { DeploymentResultType } from "@ignored/hardhat-vnext-ignition-core";
import chalk from "chalk";

import { pathFromCwd } from "./cwd-relative-path.js";
import { wasAnythingExecuted } from "./was-anything-executed.js";
Expand Down
14 changes: 6 additions & 8 deletions v-next/hardhat-ignition/src/ui/pretty-event-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import type {
UiFutureHeld,
UiFutureStatus,
UiFutureSuccess,
UiState} from "./types.js";
UiState,
} from "./types.js";
import type {
BatchInitializeEvent,
BeginNextBatchEvent,
Expand Down Expand Up @@ -40,25 +41,22 @@ import type {
StaticCallExecutionStateInitializeEvent,
TransactionConfirmEvent,
TransactionSendEvent,
WipeApplyEvent} from "@ignored/hardhat-vnext-ignition-core";
WipeApplyEvent,
} from "@ignored/hardhat-vnext-ignition-core";

import readline from "node:readline";

import {
DeploymentResultType,
ExecutionEventResultType
ExecutionEventResultType,
} from "@ignored/hardhat-vnext-ignition-core";


import { calculateBatchDisplay } from "./helpers/calculate-batch-display.js";
import { calculateDeployingModulePanel } from "./helpers/calculate-deploying-module-panel.js";
import { calculateDeploymentCompleteDisplay } from "./helpers/calculate-deployment-complete-display.js";
import { calculateStartingMessage } from "./helpers/calculate-starting-message.js";
import { wasAnythingExecuted } from "./helpers/was-anything-executed.js";
import {
UiFutureStatusType,
UiStateDeploymentStatus,
} from "./types.js";
import { UiFutureStatusType, UiStateDeploymentStatus } from "./types.js";

export class PrettyEventHandler implements ExecutionEventListener {
private _uiState: UiState = {
Expand Down
5 changes: 3 additions & 2 deletions v-next/hardhat-ignition/src/ui/verbose-event-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ import type {
StaticCallExecutionStateInitializeEvent,
TransactionConfirmEvent,
TransactionSendEvent,
WipeApplyEvent} from "@ignored/hardhat-vnext-ignition-core";
WipeApplyEvent,
} from "@ignored/hardhat-vnext-ignition-core";

import {
ExecutionEventNetworkInteractionType,
ExecutionEventResultType
ExecutionEventResultType,
} from "@ignored/hardhat-vnext-ignition-core";

export class VerboseEventHandler implements ExecutionEventListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ import type {
ExecutionErrorDeploymentResult,
PreviousRunErrorDeploymentResult,
ReconciliationErrorDeploymentResult,
ValidationErrorDeploymentResult} from "@ignored/hardhat-vnext-ignition-core";
ValidationErrorDeploymentResult,
} from "@ignored/hardhat-vnext-ignition-core";

import { HardhatError } from "@ignored/hardhat-vnext-errors";
import {
DeploymentResultType
} from "@ignored/hardhat-vnext-ignition-core";
import { DeploymentResultType } from "@ignored/hardhat-vnext-ignition-core";

/**
* Converts the result of an errored deployment into a message that can
Expand Down Expand Up @@ -136,10 +135,7 @@ function _toText({
return "holds";
}

throw new HardhatError(
HardhatError.ERRORS.INTERNAL.ASSERTION_ERROR,
{
message: "Invariant violated: neither timeouts or failures",
}
);
throw new HardhatError(HardhatError.ERRORS.INTERNAL.ASSERTION_ERROR, {
message: "Invariant violated: neither timeouts or failures",
});
}
14 changes: 7 additions & 7 deletions v-next/hardhat-ignition/src/utils/load-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ const MODULES_FOLDER = "modules";

export function loadModule(
ignitionDirectory: string,
modulePath: string
modulePath: string,
): IgnitionModule | undefined {
const fullModulesDirectoryName = path.resolve(
ignitionDirectory,
MODULES_FOLDER
MODULES_FOLDER,
);

const shortModulesDirectoryName = path.join(
ignitionDirectory,
MODULES_FOLDER
MODULES_FOLDER,
);

debug(`Loading user modules from '${fullModulesDirectoryName}'`);
Expand All @@ -36,7 +36,7 @@ export function loadModule(
HardhatError.ERRORS.IGNITION.MODULE_NOT_FOUND_AT_PATH,
{
modulePath,
}
},
);
}

Expand All @@ -46,7 +46,7 @@ export function loadModule(
{
modulePath,
shortModulesDirectoryName,
}
},
);
}

Expand All @@ -68,7 +68,7 @@ export function loadModule(

throw new HardhatError(
HardhatError.ERRORS.IGNITION.MODULE_VALIDATION_FAILED,
e
e,
);
}

Expand All @@ -87,7 +87,7 @@ function isInModuleDirectory(modulesDirectory: string, modulePath: string) {
const resolvedModulesDirectory = path.resolve(modulesDirectory);
const moduleRelativeToModuleDir = path.relative(
resolvedModulesDirectory,
modulePath
modulePath,
);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { parse as json5Parse } from "json5";
import { bigintReviver } from "./bigintReviver.js";

export async function readDeploymentParameters(
filepath: string
filepath: string,
): Promise<DeploymentParameters> {
try {
const rawFile = await readFile(filepath);
Expand All @@ -24,7 +24,7 @@ export async function readDeploymentParameters(
{
filepath,
},
e
e,
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ export async function writeVisualization(
module: SerializedIgnitionModule;
batches: string[][];
},
{ cacheDir }: { cacheDir: string }
{ cacheDir }: { cacheDir: string },
): Promise<void> {
const templateDir = path.join(
require.resolve("@nomicfoundation/ignition-ui/package.json"),
"../dist"
"../dist",
);

const templateDirExists = await pathExists(templateDir);
Expand All @@ -24,7 +24,7 @@ export async function writeVisualization(
HardhatError.ERRORS.IGNITION.VISUALIZATION_TEMPLATE_DIR_NOT_FOUND,
{
templateDir,
}
},
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
/* eslint-disable import/no-unused-modules */
import type {
TestChainHelper} from "../../test-helpers/use-ignition-project.js";
import type { TestChainHelper } from "../../test-helpers/use-ignition-project.js";

import { buildModule } from "@ignored/hardhat-vnext-ignition-core";
import { assert } from "chai";
import { createWalletClient, custom } from "viem";
import { hardhat } from "viem/chains";

import { mineBlock } from "../../test-helpers/mine-block.js";
import {
useFileIgnitionProject,
} from "../../test-helpers/use-ignition-project.js";
import { useFileIgnitionProject } from "../../test-helpers/use-ignition-project.js";
import { waitForPendingTxs } from "../../test-helpers/wait-for-pending-txs.js";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
/* eslint-disable import/no-unused-modules */
import type {
TestChainHelper} from "../../test-helpers/use-ignition-project.js";
import type { TestChainHelper } from "../../test-helpers/use-ignition-project.js";

import { buildModule } from "@ignored/hardhat-vnext-ignition-core";
import { assert } from "chai";
import { createWalletClient, custom, parseEther } from "viem";
import { hardhat } from "viem/chains";

import {
useFileIgnitionProject,
} from "../../test-helpers/use-ignition-project.js";
import { useFileIgnitionProject } from "../../test-helpers/use-ignition-project.js";

/**
* Run an initial deploy, that starts but does not finish several on-chain
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
/* eslint-disable import/no-unused-modules */
import type {
TestChainHelper} from "../../test-helpers/use-ignition-project.js";
import type { TestChainHelper } from "../../test-helpers/use-ignition-project.js";

import { buildModule } from "@ignored/hardhat-vnext-ignition-core";
import { assert } from "chai";

import {
useFileIgnitionProject,
} from "../../test-helpers/use-ignition-project.js";
import { useFileIgnitionProject } from "../../test-helpers/use-ignition-project.js";

/**
* On running a deploy, if a transaction is dropped from the mempool
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
/* eslint-disable import/no-unused-modules */
import type {
TestChainHelper} from "../../test-helpers/use-ignition-project.js";
import type { TestChainHelper } from "../../test-helpers/use-ignition-project.js";

import { buildModule } from "@ignored/hardhat-vnext-ignition-core";
import { assert } from "chai";
import { createWalletClient, custom } from "viem";
import { hardhat } from "viem/chains";

import {
useFileIgnitionProject,
} from "../../test-helpers/use-ignition-project.js";
import { useFileIgnitionProject } from "../../test-helpers/use-ignition-project.js";

/**
* On running a deploy, if a transaction is pending and the user
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
/* eslint-disable import/no-unused-modules */
import type {
TestChainHelper} from "../../test-helpers/use-ignition-project.js";
import type { TestChainHelper } from "../../test-helpers/use-ignition-project.js";

import { buildModule } from "@ignored/hardhat-vnext-ignition-core";
import { assert } from "chai";

import { clearPendingTransactionsFromMemoryPool } from "../../test-helpers/clear-pending-transactions-from-memory-pool.js";
import { mineBlock } from "../../test-helpers/mine-block.js";
import {
useFileIgnitionProject,
} from "../../test-helpers/use-ignition-project.js";
import { useFileIgnitionProject } from "../../test-helpers/use-ignition-project.js";

/**
* Run an initial deploy, that starts but does not finish an on-chain
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
/* eslint-disable import/no-unused-modules */
import type {
TestChainHelper} from "../../test-helpers/use-ignition-project.js";
import type { TestChainHelper } from "../../test-helpers/use-ignition-project.js";

import { buildModule } from "@ignored/hardhat-vnext-ignition-core";
import { assert } from "chai";

import { mineBlock } from "../../test-helpers/mine-block.js";
import {
useFileIgnitionProject,
} from "../../test-helpers/use-ignition-project.js";
import { useFileIgnitionProject } from "../../test-helpers/use-ignition-project.js";

/**
* Run an initial deploy, that sumbit but does not confirm several on-chain
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
/* eslint-disable import/no-unused-modules */
import type {
TestChainHelper} from "../../test-helpers/use-ignition-project.js";
import type { TestChainHelper } from "../../test-helpers/use-ignition-project.js";

import { buildModule } from "@ignored/hardhat-vnext-ignition-core";
import { assert } from "chai";

import {
useFileIgnitionProject,
} from "../../test-helpers/use-ignition-project.js";
import { useFileIgnitionProject } from "../../test-helpers/use-ignition-project.js";

/**
* Run an initial deploy, that starts but does not finish several on-chain
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* eslint-disable import/no-unused-modules */
import type {
TestChainHelper} from "../../test-helpers/use-ignition-project.js";
import type { TestChainHelper } from "../../test-helpers/use-ignition-project.js";

import { buildModule } from "@ignored/hardhat-vnext-ignition-core";
import { assert } from "chai";
Expand All @@ -9,9 +8,7 @@ import { hardhat } from "viem/chains";

import { mineBlock } from "../../test-helpers/mine-block.js";
import { sleep } from "../../test-helpers/sleep.js";
import {
useFileIgnitionProject,
} from "../../test-helpers/use-ignition-project.js";
import { useFileIgnitionProject } from "../../test-helpers/use-ignition-project.js";

/**
* Run an initial deploy, that starts but does not finish several on-chain
Expand Down
Loading

0 comments on commit 1679340

Please sign in to comment.