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

Support returning multiple validation errors (PR 1) #476

Merged
merged 6 commits into from
Oct 2, 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
8 changes: 5 additions & 3 deletions packages/core/src/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { BasicExecutionStrategy } from "./internal/execution/basic-execution-str
import { EIP1193JsonRpcClient } from "./internal/execution/jsonrpc-client";
import { getDefaultSender } from "./internal/execution/utils/get-default-sender";
import { checkAutominedNetwork } from "./internal/utils/check-automined-network";
import { validateStageOne } from "./internal/validation/validateStageOne";
import { validate } from "./internal/validation/validate";
import { ArtifactResolver } from "./types/artifact";
import {
DeployConfig,
Expand Down Expand Up @@ -66,9 +66,11 @@ export async function deploy<
});
}

const validationResult = await validateStageOne(
const validationResult = await validate(
ignitionModule,
artifactResolver
artifactResolver,
deploymentParameters,
accounts
);

if (validationResult !== null) {
Expand Down
14 changes: 0 additions & 14 deletions packages/core/src/internal/deployer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import { formatExecutionError } from "./formatters";
import { Reconciler } from "./reconciliation/reconciler";
import { assertIgnitionInvariant } from "./utils/assertions";
import { getFuturesFromModule } from "./utils/get-futures-from-module";
import { validateStageTwo } from "./validation/validateStageTwo";

/**
* Run an Igntition deployment.
Expand Down Expand Up @@ -78,19 +77,6 @@ export class Deployer {
accounts: string[],
defaultSender: string
): Promise<DeploymentResult<ContractNameT, IgnitionModuleResultsT>> {
const validationResult = await validateStageTwo(
ignitionModule,
this._artifactResolver,
deploymentParameters,
accounts
);

if (validationResult !== null) {
this._emitDeploymentCompleteEvent(validationResult);

return validationResult;
}

let deploymentState = await this._getOrInitializeDeploymentState(
ignitionModule.id
);
Expand Down
Loading
Loading