From c5b048d737ce66a3adf9897d98c9dd167c5d750c Mon Sep 17 00:00:00 2001 From: Patricio Palladino Date: Thu, 14 Sep 2023 19:37:35 +0000 Subject: [PATCH] Rename futures --- .../helpers/save-artifacts-for-future.ts | 12 +-- packages/core/src/internal/module-builder.ts | 58 +++++++------- packages/core/src/internal/module.ts | 38 ++++----- .../futures/reconcileArtifactContractAt.ts | 4 +- .../reconcileArtifactContractDeployment.ts | 4 +- .../reconcileArtifactLibraryDeployment.ts | 4 +- .../futures/reconcileNamedContractAt.ts | 4 +- .../futures/reconcileNamedContractCall.ts | 4 +- .../reconcileNamedContractDeployment.ts | 4 +- .../reconcileNamedLibraryDeployment.ts | 4 +- .../futures/reconcileNamedStaticCall.ts | 4 +- .../helpers/reconcile-address.ts | 6 +- .../helpers/reconcile-arguments.ts | 16 ++-- .../helpers/reconcile-artifacts.ts | 24 +++--- .../helpers/reconcile-contract-name.ts | 24 +++--- .../helpers/reconcile-contract.ts | 9 +-- .../reconciliation/helpers/reconcile-from.ts | 24 +++--- .../helpers/reconcile-function-name.ts | 9 +-- .../helpers/reconcile-libraries.ts | 16 ++-- .../reconciliation/helpers/reconcile-value.ts | 12 +-- .../stageOne/validateArtifactContractAt.ts | 4 +- .../validateArtifactContractDeployment.ts | 4 +- .../validateArtifactLibraryDeployment.ts | 4 +- .../stageOne/validateNamedContractAt.ts | 4 +- .../stageOne/validateNamedContractCall.ts | 4 +- .../validateNamedContractDeployment.ts | 4 +- .../validateNamedLibraryDeployment.ts | 4 +- .../stageOne/validateNamedStaticCall.ts | 4 +- .../stageTwo/validateArtifactContractAt.ts | 4 +- .../validateArtifactContractDeployment.ts | 4 +- .../validateArtifactLibraryDeployment.ts | 4 +- .../stageTwo/validateNamedContractAt.ts | 4 +- .../stageTwo/validateNamedContractCall.ts | 4 +- .../validateNamedContractDeployment.ts | 4 +- .../validateNamedLibraryDeployment.ts | 4 +- .../stageTwo/validateNamedStaticCall.ts | 4 +- .../core/src/stored-deployment-serializer.ts | 12 +-- packages/core/src/type-guards.ts | 36 ++++----- packages/core/src/types/module-builder.ts | 38 ++++----- packages/core/src/types/module.ts | 78 ++++++++++--------- .../helpers/build-initialize-message-for.ts | 36 ++++----- .../future-processor/named-contract-deploy.ts | 4 +- .../hardhat-plugin/src/ignition-helper.ts | 8 +- 43 files changed, 275 insertions(+), 281 deletions(-) diff --git a/packages/core/src/internal/execution/future-processor/helpers/save-artifacts-for-future.ts b/packages/core/src/internal/execution/future-processor/helpers/save-artifacts-for-future.ts index 13b6e6e9c..c934dc6ae 100644 --- a/packages/core/src/internal/execution/future-processor/helpers/save-artifacts-for-future.ts +++ b/packages/core/src/internal/execution/future-processor/helpers/save-artifacts-for-future.ts @@ -2,9 +2,9 @@ import { ArtifactResolver } from "../../../../types/artifact"; import { Future, FutureType, - NamedContractAtFuture, - NamedContractDeploymentFuture, - NamedLibraryDeploymentFuture, + NamedArtifactContractAtFuture, + NamedArtifactContractDeploymentFuture, + NamedArtifactLibraryDeploymentFuture, } from "../../../../types/module"; import { DeploymentLoader } from "../../../deployment-loader/types"; @@ -38,9 +38,9 @@ export async function saveArtifactsForFuture( async function _storeArtifactAndBuildInfoAgainstDeployment( future: - | NamedLibraryDeploymentFuture - | NamedContractDeploymentFuture - | NamedContractAtFuture, + | NamedArtifactLibraryDeploymentFuture + | NamedArtifactContractDeploymentFuture + | NamedArtifactContractAtFuture, { deploymentLoader, artifactResolver, diff --git a/packages/core/src/internal/module-builder.ts b/packages/core/src/internal/module-builder.ts index 94328cae4..d93bf4318 100644 --- a/packages/core/src/internal/module-builder.ts +++ b/packages/core/src/internal/module-builder.ts @@ -16,9 +16,9 @@ import { AccountRuntimeValue, AddressResolvableFuture, ArgumentType, - ArtifactContractAtFuture, - ArtifactContractDeploymentFuture, - ArtifactLibraryDeploymentFuture, + ContractAtFuture, + ContractDeploymentFuture, + LibraryDeploymentFuture, CallableContractFuture, ContractFuture, FutureType, @@ -27,11 +27,11 @@ import { ModuleParameterRuntimeValue, ModuleParameterType, ModuleParameters, - NamedContractAtFuture, - NamedContractCallFuture, - NamedContractDeploymentFuture, - NamedLibraryDeploymentFuture, - NamedStaticCallFuture, + NamedArtifactContractAtFuture, + ContractCallFuture, + NamedArtifactContractDeploymentFuture, + NamedArtifactLibraryDeploymentFuture, + StaticCallFuture, ReadEventArgumentFuture, SendDataFuture, } from "../types/module"; @@ -180,21 +180,21 @@ class IgnitionModuleBuilderImplementation< contractName: ContractNameT, args?: ArgumentType[], options?: ContractOptions - ): NamedContractDeploymentFuture; + ): NamedArtifactContractDeploymentFuture; public contract( contractName: string, artifact: Artifact, args?: ArgumentType[], options?: ContractOptions - ): ArtifactContractDeploymentFuture; + ): ContractDeploymentFuture; public contract( contractName: ContractNameT, artifactOrArgs?: Artifact | ArgumentType[], argsorOptions?: ArgumentType[] | ContractAtOptions, maybeOptions?: ContractOptions ): - | NamedContractDeploymentFuture - | ArtifactContractDeploymentFuture { + | NamedArtifactContractDeploymentFuture + | ContractDeploymentFuture { if (artifactOrArgs === undefined || Array.isArray(artifactOrArgs)) { if (Array.isArray(argsorOptions)) { this._throwErrorWithStackTrace( @@ -229,7 +229,7 @@ class IgnitionModuleBuilderImplementation< contractName: ContractNameT, args: ArgumentType[] = [], options: ContractOptions = {} - ): NamedContractDeploymentFuture { + ): NamedArtifactContractDeploymentFuture { const futureId = toDeploymentFutureId( this._module.id, options.id, @@ -280,7 +280,7 @@ class IgnitionModuleBuilderImplementation< artifact: Artifact, args: ArgumentType[] = [], options: ContractOptions = {} - ): ArtifactContractDeploymentFuture { + ): ContractDeploymentFuture { const futureId = toDeploymentFutureId( this._module.id, options.id, @@ -332,12 +332,12 @@ class IgnitionModuleBuilderImplementation< public library( libraryName: LibraryNameT, options?: LibraryOptions - ): NamedLibraryDeploymentFuture; + ): NamedArtifactLibraryDeploymentFuture; public library( libraryName: string, artifact: Artifact, options?: LibraryOptions - ): ArtifactLibraryDeploymentFuture; + ): LibraryDeploymentFuture; public library( libraryName: LibraryNameT, artifactOrOptions?: Artifact | LibraryOptions, @@ -353,7 +353,7 @@ class IgnitionModuleBuilderImplementation< private _namedArtifactLibrary( libraryName: LibraryNameT, options: LibraryOptions = {} - ): NamedLibraryDeploymentFuture { + ): NamedArtifactLibraryDeploymentFuture { const futureId = toDeploymentFutureId( this._module.id, options.id, @@ -395,7 +395,7 @@ class IgnitionModuleBuilderImplementation< libraryName: string, artifact: Artifact, options: LibraryOptions = {} - ): ArtifactLibraryDeploymentFuture { + ): LibraryDeploymentFuture { const futureId = toDeploymentFutureId( this._module.id, options.id, @@ -439,7 +439,7 @@ class IgnitionModuleBuilderImplementation< functionName: FunctionNameT, args: ArgumentType[] = [], options: CallOptions = {} - ): NamedContractCallFuture { + ): ContractCallFuture { const futureId = toCallFutureId( this._module.id, options.id, @@ -489,7 +489,7 @@ class IgnitionModuleBuilderImplementation< args: ArgumentType[] = [], nameOrIndex: string | number = 0, options: StaticCallOptions = {} - ): NamedStaticCallFuture { + ): StaticCallFuture { const futureId = toCallFutureId( this._module.id, options.id, @@ -538,7 +538,7 @@ class IgnitionModuleBuilderImplementation< | AddressResolvableFuture | ModuleParameterRuntimeValue, options?: ContractAtOptions - ): NamedContractAtFuture; + ): NamedArtifactContractAtFuture; public contractAt( contractName: string, address: @@ -547,7 +547,7 @@ class IgnitionModuleBuilderImplementation< | ModuleParameterRuntimeValue, artifact: Artifact, options?: ContractAtOptions - ): ArtifactContractAtFuture; + ): ContractAtFuture; public contractAt( contractName: ContractNameT, address: @@ -580,7 +580,7 @@ class IgnitionModuleBuilderImplementation< | AddressResolvableFuture | ModuleParameterRuntimeValue, options: ContractAtOptions = {} - ): NamedContractAtFuture { + ): NamedArtifactContractAtFuture { const futureId = toDeploymentFutureId( this._module.id, options.id, @@ -622,7 +622,7 @@ class IgnitionModuleBuilderImplementation< | ModuleParameterRuntimeValue, artifact: Artifact, options: ContractAtOptions = {} - ): ArtifactContractAtFuture { + ): ContractAtFuture { const futureId = toDeploymentFutureId( this._module.id, options.id, @@ -660,10 +660,10 @@ class IgnitionModuleBuilderImplementation< public readEventArgument( futureToReadFrom: - | NamedContractDeploymentFuture - | ArtifactContractDeploymentFuture + | NamedArtifactContractDeploymentFuture + | ContractDeploymentFuture | SendDataFuture - | NamedContractCallFuture, + | ContractCallFuture, eventName: string, nameOrIndex: string | number, options: ReadEventArgumentOptions = {} @@ -683,8 +683,8 @@ class IgnitionModuleBuilderImplementation< "contract" in futureToReadFrom ? futureToReadFrom.contract : (futureToReadFrom as - | ArtifactContractDeploymentFuture - | NamedContractDeploymentFuture); + | ContractDeploymentFuture + | NamedArtifactContractDeploymentFuture); const emitter = options.emitter ?? contractToReadFrom; diff --git a/packages/core/src/internal/module.ts b/packages/core/src/internal/module.ts index cf9398aed..966a6e24d 100644 --- a/packages/core/src/internal/module.ts +++ b/packages/core/src/internal/module.ts @@ -3,9 +3,9 @@ import { AccountRuntimeValue, AddressResolvableFuture, ArgumentType, - ArtifactContractAtFuture, - ArtifactContractDeploymentFuture, - ArtifactLibraryDeploymentFuture, + ContractAtFuture, + ContractDeploymentFuture, + LibraryDeploymentFuture, ContractFuture, Future, FutureType, @@ -13,11 +13,11 @@ import { IgnitionModuleResult, ModuleParameterRuntimeValue, ModuleParameterType, - NamedContractAtFuture, - NamedContractCallFuture, - NamedContractDeploymentFuture, - NamedLibraryDeploymentFuture, - NamedStaticCallFuture, + NamedArtifactContractAtFuture, + ContractCallFuture, + NamedArtifactContractDeploymentFuture, + NamedArtifactLibraryDeploymentFuture, + StaticCallFuture, ReadEventArgumentFuture, RuntimeValueType, SendDataFuture, @@ -54,7 +54,7 @@ export class NamedContractDeploymentFutureImplementation< ContractNameT extends string > extends BaseFutureImplementation - implements NamedContractDeploymentFuture + implements NamedArtifactContractDeploymentFuture { constructor( public readonly id: string, @@ -73,7 +73,7 @@ export class ArtifactContractDeploymentFutureImplementation< ContractNameT extends string > extends BaseFutureImplementation - implements ArtifactContractDeploymentFuture + implements ContractDeploymentFuture { constructor( public readonly id: string, @@ -93,7 +93,7 @@ export class NamedLibraryDeploymentFutureImplementation< LibraryNameT extends string > extends BaseFutureImplementation - implements NamedLibraryDeploymentFuture + implements NamedArtifactLibraryDeploymentFuture { constructor( public readonly id: string, @@ -110,7 +110,7 @@ export class ArtifactLibraryDeploymentFutureImplementation< LibraryNameT extends string > extends BaseFutureImplementation - implements ArtifactLibraryDeploymentFuture + implements LibraryDeploymentFuture { constructor( public readonly id: string, @@ -129,7 +129,7 @@ export class NamedContractCallFutureImplementation< FunctionNameT extends string > extends BaseFutureImplementation - implements NamedContractCallFuture + implements ContractCallFuture { constructor( public readonly id: string, @@ -149,7 +149,7 @@ export class NamedStaticCallFutureImplementation< FunctionNameT extends string > extends BaseFutureImplementation - implements NamedStaticCallFuture + implements StaticCallFuture { constructor( public readonly id: string, @@ -166,7 +166,7 @@ export class NamedStaticCallFutureImplementation< export class NamedContractAtFutureImplementation extends BaseFutureImplementation - implements NamedContractAtFuture + implements NamedArtifactContractAtFuture { constructor( public readonly id: string, @@ -183,7 +183,7 @@ export class NamedContractAtFutureImplementation export class ArtifactContractAtFutureImplementation extends BaseFutureImplementation - implements ArtifactContractAtFuture + implements ContractAtFuture { constructor( public readonly id: string, @@ -207,10 +207,10 @@ export class ReadEventArgumentFutureImplementation public readonly id: string, public readonly module: IgnitionModuleImplementation, public readonly futureToReadFrom: - | NamedContractDeploymentFuture - | ArtifactContractDeploymentFuture + | NamedArtifactContractDeploymentFuture + | ContractDeploymentFuture | SendDataFuture - | NamedContractCallFuture, + | ContractCallFuture, public readonly eventName: string, public readonly nameOrIndex: string | number, public readonly emitter: ContractFuture, diff --git a/packages/core/src/internal/reconciliation/futures/reconcileArtifactContractAt.ts b/packages/core/src/internal/reconciliation/futures/reconcileArtifactContractAt.ts index ff8fa925e..82182cc8d 100644 --- a/packages/core/src/internal/reconciliation/futures/reconcileArtifactContractAt.ts +++ b/packages/core/src/internal/reconciliation/futures/reconcileArtifactContractAt.ts @@ -1,4 +1,4 @@ -import { ArtifactContractAtFuture } from "../../../types/module"; +import { ContractAtFuture } from "../../../types/module"; import { ContractAtExecutionState } from "../../execution/types/execution-state"; import { reconcileAddress } from "../helpers/reconcile-address"; import { reconcileArtifacts } from "../helpers/reconcile-artifacts"; @@ -6,7 +6,7 @@ import { reconcileContractName } from "../helpers/reconcile-contract-name"; import { ReconciliationContext, ReconciliationFutureResult } from "../types"; export async function reconcileArtifactContractAt( - future: ArtifactContractAtFuture, + future: ContractAtFuture, executionState: ContractAtExecutionState, context: ReconciliationContext ): Promise { diff --git a/packages/core/src/internal/reconciliation/futures/reconcileArtifactContractDeployment.ts b/packages/core/src/internal/reconciliation/futures/reconcileArtifactContractDeployment.ts index b0c7be150..33abd0ac8 100644 --- a/packages/core/src/internal/reconciliation/futures/reconcileArtifactContractDeployment.ts +++ b/packages/core/src/internal/reconciliation/futures/reconcileArtifactContractDeployment.ts @@ -1,4 +1,4 @@ -import { ArtifactContractDeploymentFuture } from "../../../types/module"; +import { ContractDeploymentFuture } from "../../../types/module"; import { DeploymentExecutionState } from "../../execution/types/execution-state"; import { reconcileArguments } from "../helpers/reconcile-arguments"; import { reconcileArtifacts } from "../helpers/reconcile-artifacts"; @@ -9,7 +9,7 @@ import { reconcileValue } from "../helpers/reconcile-value"; import { ReconciliationContext, ReconciliationFutureResult } from "../types"; export async function reconcileArtifactContractDeployment( - future: ArtifactContractDeploymentFuture, + future: ContractDeploymentFuture, executionState: DeploymentExecutionState, context: ReconciliationContext ): Promise { diff --git a/packages/core/src/internal/reconciliation/futures/reconcileArtifactLibraryDeployment.ts b/packages/core/src/internal/reconciliation/futures/reconcileArtifactLibraryDeployment.ts index a13a656b7..0bcaebf58 100644 --- a/packages/core/src/internal/reconciliation/futures/reconcileArtifactLibraryDeployment.ts +++ b/packages/core/src/internal/reconciliation/futures/reconcileArtifactLibraryDeployment.ts @@ -1,4 +1,4 @@ -import { ArtifactLibraryDeploymentFuture } from "../../../types/module"; +import { LibraryDeploymentFuture } from "../../../types/module"; import { DeploymentExecutionState } from "../../execution/types/execution-state"; import { reconcileArtifacts } from "../helpers/reconcile-artifacts"; import { reconcileContractName } from "../helpers/reconcile-contract-name"; @@ -7,7 +7,7 @@ import { reconcileLibraries } from "../helpers/reconcile-libraries"; import { ReconciliationContext, ReconciliationFutureResult } from "../types"; export async function reconcileArtifactLibraryDeployment( - future: ArtifactLibraryDeploymentFuture, + future: LibraryDeploymentFuture, executionState: DeploymentExecutionState, context: ReconciliationContext ): Promise { diff --git a/packages/core/src/internal/reconciliation/futures/reconcileNamedContractAt.ts b/packages/core/src/internal/reconciliation/futures/reconcileNamedContractAt.ts index 958cbf330..fbe46daa0 100644 --- a/packages/core/src/internal/reconciliation/futures/reconcileNamedContractAt.ts +++ b/packages/core/src/internal/reconciliation/futures/reconcileNamedContractAt.ts @@ -1,4 +1,4 @@ -import { NamedContractAtFuture } from "../../../types/module"; +import { NamedArtifactContractAtFuture } from "../../../types/module"; import { ContractAtExecutionState } from "../../execution/types/execution-state"; import { reconcileAddress } from "../helpers/reconcile-address"; import { reconcileArtifacts } from "../helpers/reconcile-artifacts"; @@ -6,7 +6,7 @@ import { reconcileContractName } from "../helpers/reconcile-contract-name"; import { ReconciliationContext, ReconciliationFutureResult } from "../types"; export async function reconcileNamedContractAt( - future: NamedContractAtFuture, + future: NamedArtifactContractAtFuture, executionState: ContractAtExecutionState, context: ReconciliationContext ): Promise { diff --git a/packages/core/src/internal/reconciliation/futures/reconcileNamedContractCall.ts b/packages/core/src/internal/reconciliation/futures/reconcileNamedContractCall.ts index 8ee4e9dd9..02f2195c9 100644 --- a/packages/core/src/internal/reconciliation/futures/reconcileNamedContractCall.ts +++ b/packages/core/src/internal/reconciliation/futures/reconcileNamedContractCall.ts @@ -1,4 +1,4 @@ -import { NamedContractCallFuture } from "../../../types/module"; +import { ContractCallFuture } from "../../../types/module"; import { CallExecutionState } from "../../execution/types/execution-state"; import { reconcileArguments } from "../helpers/reconcile-arguments"; import { reconcileContract } from "../helpers/reconcile-contract"; @@ -8,7 +8,7 @@ import { reconcileValue } from "../helpers/reconcile-value"; import { ReconciliationContext, ReconciliationFutureResult } from "../types"; export function reconcileNamedContractCall( - future: NamedContractCallFuture, + future: ContractCallFuture, executionState: CallExecutionState, context: ReconciliationContext ): ReconciliationFutureResult { diff --git a/packages/core/src/internal/reconciliation/futures/reconcileNamedContractDeployment.ts b/packages/core/src/internal/reconciliation/futures/reconcileNamedContractDeployment.ts index c7dc411df..5d34bcd12 100644 --- a/packages/core/src/internal/reconciliation/futures/reconcileNamedContractDeployment.ts +++ b/packages/core/src/internal/reconciliation/futures/reconcileNamedContractDeployment.ts @@ -1,4 +1,4 @@ -import { NamedContractDeploymentFuture } from "../../../types/module"; +import { NamedArtifactContractDeploymentFuture } from "../../../types/module"; import { DeploymentExecutionState } from "../../execution/types/execution-state"; import { reconcileArguments } from "../helpers/reconcile-arguments"; import { reconcileArtifacts } from "../helpers/reconcile-artifacts"; @@ -9,7 +9,7 @@ import { reconcileValue } from "../helpers/reconcile-value"; import { ReconciliationContext, ReconciliationFutureResult } from "../types"; export async function reconcileNamedContractDeployment( - future: NamedContractDeploymentFuture, + future: NamedArtifactContractDeploymentFuture, executionState: DeploymentExecutionState, context: ReconciliationContext ): Promise { diff --git a/packages/core/src/internal/reconciliation/futures/reconcileNamedLibraryDeployment.ts b/packages/core/src/internal/reconciliation/futures/reconcileNamedLibraryDeployment.ts index a01e7963e..41400165a 100644 --- a/packages/core/src/internal/reconciliation/futures/reconcileNamedLibraryDeployment.ts +++ b/packages/core/src/internal/reconciliation/futures/reconcileNamedLibraryDeployment.ts @@ -1,4 +1,4 @@ -import { NamedLibraryDeploymentFuture } from "../../../types/module"; +import { NamedArtifactLibraryDeploymentFuture } from "../../../types/module"; import { DeploymentExecutionState } from "../../execution/types/execution-state"; import { reconcileArtifacts } from "../helpers/reconcile-artifacts"; import { reconcileContractName } from "../helpers/reconcile-contract-name"; @@ -7,7 +7,7 @@ import { reconcileLibraries } from "../helpers/reconcile-libraries"; import { ReconciliationContext, ReconciliationFutureResult } from "../types"; export async function reconcileNamedLibraryDeployment( - future: NamedLibraryDeploymentFuture, + future: NamedArtifactLibraryDeploymentFuture, executionState: DeploymentExecutionState, context: ReconciliationContext ): Promise { diff --git a/packages/core/src/internal/reconciliation/futures/reconcileNamedStaticCall.ts b/packages/core/src/internal/reconciliation/futures/reconcileNamedStaticCall.ts index b1f8895e1..a816fd53f 100644 --- a/packages/core/src/internal/reconciliation/futures/reconcileNamedStaticCall.ts +++ b/packages/core/src/internal/reconciliation/futures/reconcileNamedStaticCall.ts @@ -1,4 +1,4 @@ -import { NamedStaticCallFuture } from "../../../types/module"; +import { StaticCallFuture } from "../../../types/module"; import { StaticCallExecutionState } from "../../execution/types/execution-state"; import { compare } from "../helpers/compare"; import { reconcileArguments } from "../helpers/reconcile-arguments"; @@ -8,7 +8,7 @@ import { reconcileFunctionName } from "../helpers/reconcile-function-name"; import { ReconciliationContext, ReconciliationFutureResult } from "../types"; export function reconcileNamedStaticCall( - future: NamedStaticCallFuture, + future: StaticCallFuture, executionState: StaticCallExecutionState, context: ReconciliationContext ): ReconciliationFutureResult { diff --git a/packages/core/src/internal/reconciliation/helpers/reconcile-address.ts b/packages/core/src/internal/reconciliation/helpers/reconcile-address.ts index 6c4114913..23e16d052 100644 --- a/packages/core/src/internal/reconciliation/helpers/reconcile-address.ts +++ b/packages/core/src/internal/reconciliation/helpers/reconcile-address.ts @@ -1,6 +1,6 @@ import { - ArtifactContractAtFuture, - NamedContractAtFuture, + ContractAtFuture, + NamedArtifactContractAtFuture, } from "../../../types/module"; import { resolveAddressLike } from "../../execution/future-processor/helpers/future-resolvers"; import { ContractAtExecutionState } from "../../execution/types/execution-state"; @@ -12,7 +12,7 @@ import { import { compare } from "./compare"; export function reconcileAddress( - future: NamedContractAtFuture | ArtifactContractAtFuture, + future: NamedArtifactContractAtFuture | ContractAtFuture, exState: ContractAtExecutionState, context: ReconciliationContext ): ReconciliationFutureResultFailure | undefined { diff --git a/packages/core/src/internal/reconciliation/helpers/reconcile-arguments.ts b/packages/core/src/internal/reconciliation/helpers/reconcile-arguments.ts index bb649e959..071c09529 100644 --- a/packages/core/src/internal/reconciliation/helpers/reconcile-arguments.ts +++ b/packages/core/src/internal/reconciliation/helpers/reconcile-arguments.ts @@ -1,9 +1,9 @@ import { isDeploymentFuture } from "../../../type-guards"; import { - ArtifactContractDeploymentFuture, - NamedContractCallFuture, - NamedContractDeploymentFuture, - NamedStaticCallFuture, + ContractDeploymentFuture, + ContractCallFuture, + NamedArtifactContractDeploymentFuture, + StaticCallFuture, } from "../../../types/module"; import { resolveArgs } from "../../execution/future-processor/helpers/future-resolvers"; import { @@ -20,10 +20,10 @@ import { fail } from "../utils"; export function reconcileArguments( future: - | NamedContractDeploymentFuture - | ArtifactContractDeploymentFuture - | NamedStaticCallFuture - | NamedContractCallFuture, + | NamedArtifactContractDeploymentFuture + | ContractDeploymentFuture + | StaticCallFuture + | ContractCallFuture, exState: | DeploymentExecutionState | CallExecutionState diff --git a/packages/core/src/internal/reconciliation/helpers/reconcile-artifacts.ts b/packages/core/src/internal/reconciliation/helpers/reconcile-artifacts.ts index b262350aa..6318280c8 100644 --- a/packages/core/src/internal/reconciliation/helpers/reconcile-artifacts.ts +++ b/packages/core/src/internal/reconciliation/helpers/reconcile-artifacts.ts @@ -1,10 +1,10 @@ import { - ArtifactContractAtFuture, - ArtifactContractDeploymentFuture, - ArtifactLibraryDeploymentFuture, - NamedContractAtFuture, - NamedContractDeploymentFuture, - NamedLibraryDeploymentFuture, + ContractAtFuture, + ContractDeploymentFuture, + LibraryDeploymentFuture, + NamedArtifactContractAtFuture, + NamedArtifactContractDeploymentFuture, + NamedArtifactLibraryDeploymentFuture, } from "../../../types/module"; import { ContractAtExecutionState, @@ -18,12 +18,12 @@ import { fail, getBytecodeWithoutMetadata } from "../utils"; export async function reconcileArtifacts( future: - | NamedContractDeploymentFuture - | ArtifactContractDeploymentFuture - | NamedLibraryDeploymentFuture - | ArtifactLibraryDeploymentFuture - | NamedContractAtFuture - | ArtifactContractAtFuture, + | NamedArtifactContractDeploymentFuture + | ContractDeploymentFuture + | NamedArtifactLibraryDeploymentFuture + | LibraryDeploymentFuture + | NamedArtifactContractAtFuture + | ContractAtFuture, exState: DeploymentExecutionState | ContractAtExecutionState, context: ReconciliationContext ): Promise { diff --git a/packages/core/src/internal/reconciliation/helpers/reconcile-contract-name.ts b/packages/core/src/internal/reconciliation/helpers/reconcile-contract-name.ts index e412e328a..c3e1d04ec 100644 --- a/packages/core/src/internal/reconciliation/helpers/reconcile-contract-name.ts +++ b/packages/core/src/internal/reconciliation/helpers/reconcile-contract-name.ts @@ -1,10 +1,10 @@ import { - ArtifactContractAtFuture, - ArtifactContractDeploymentFuture, - ArtifactLibraryDeploymentFuture, - NamedContractAtFuture, - NamedContractDeploymentFuture, - NamedLibraryDeploymentFuture, + ContractAtFuture, + ContractDeploymentFuture, + LibraryDeploymentFuture, + NamedArtifactContractAtFuture, + NamedArtifactContractDeploymentFuture, + NamedArtifactLibraryDeploymentFuture, } from "../../../types/module"; import { ContractAtExecutionState, @@ -19,12 +19,12 @@ import { compare } from "./compare"; export function reconcileContractName( future: - | NamedContractDeploymentFuture - | ArtifactContractDeploymentFuture - | NamedLibraryDeploymentFuture - | ArtifactLibraryDeploymentFuture - | NamedContractAtFuture - | ArtifactContractAtFuture, + | NamedArtifactContractDeploymentFuture + | ContractDeploymentFuture + | NamedArtifactLibraryDeploymentFuture + | LibraryDeploymentFuture + | NamedArtifactContractAtFuture + | ContractAtFuture, exState: DeploymentExecutionState | ContractAtExecutionState, _context: ReconciliationContext ): ReconciliationFutureResultFailure | undefined { diff --git a/packages/core/src/internal/reconciliation/helpers/reconcile-contract.ts b/packages/core/src/internal/reconciliation/helpers/reconcile-contract.ts index 3fb7093d4..c1292106b 100644 --- a/packages/core/src/internal/reconciliation/helpers/reconcile-contract.ts +++ b/packages/core/src/internal/reconciliation/helpers/reconcile-contract.ts @@ -1,7 +1,4 @@ -import { - NamedContractCallFuture, - NamedStaticCallFuture, -} from "../../../types/module"; +import { ContractCallFuture, StaticCallFuture } from "../../../types/module"; import { resolveAddressLike } from "../../execution/future-processor/helpers/future-resolvers"; import { CallExecutionState, @@ -15,9 +12,7 @@ import { import { compare } from "./compare"; export function reconcileContract( - future: - | NamedContractCallFuture - | NamedStaticCallFuture, + future: ContractCallFuture | StaticCallFuture, exState: CallExecutionState | StaticCallExecutionState, context: ReconciliationContext ): ReconciliationFutureResultFailure | undefined { diff --git a/packages/core/src/internal/reconciliation/helpers/reconcile-from.ts b/packages/core/src/internal/reconciliation/helpers/reconcile-from.ts index a07cac7ed..287be1562 100644 --- a/packages/core/src/internal/reconciliation/helpers/reconcile-from.ts +++ b/packages/core/src/internal/reconciliation/helpers/reconcile-from.ts @@ -1,10 +1,10 @@ import { - ArtifactContractDeploymentFuture, - ArtifactLibraryDeploymentFuture, - NamedContractCallFuture, - NamedContractDeploymentFuture, - NamedLibraryDeploymentFuture, - NamedStaticCallFuture, + ContractDeploymentFuture, + LibraryDeploymentFuture, + ContractCallFuture, + NamedArtifactContractDeploymentFuture, + NamedArtifactLibraryDeploymentFuture, + StaticCallFuture, SendDataFuture, } from "../../../types/module"; import { resolveFutureFrom } from "../../execution/future-processor/helpers/future-resolvers"; @@ -23,12 +23,12 @@ import { compare } from "./compare"; export function reconcileFrom( future: - | NamedContractDeploymentFuture - | ArtifactContractDeploymentFuture - | NamedLibraryDeploymentFuture - | ArtifactLibraryDeploymentFuture - | NamedContractCallFuture - | NamedStaticCallFuture + | NamedArtifactContractDeploymentFuture + | ContractDeploymentFuture + | NamedArtifactLibraryDeploymentFuture + | LibraryDeploymentFuture + | ContractCallFuture + | StaticCallFuture | SendDataFuture, exState: | DeploymentExecutionState diff --git a/packages/core/src/internal/reconciliation/helpers/reconcile-function-name.ts b/packages/core/src/internal/reconciliation/helpers/reconcile-function-name.ts index e2a73c517..023005d9d 100644 --- a/packages/core/src/internal/reconciliation/helpers/reconcile-function-name.ts +++ b/packages/core/src/internal/reconciliation/helpers/reconcile-function-name.ts @@ -1,7 +1,4 @@ -import { - NamedContractCallFuture, - NamedStaticCallFuture, -} from "../../../types/module"; +import { ContractCallFuture, StaticCallFuture } from "../../../types/module"; import { CallExecutionState, StaticCallExecutionState, @@ -14,9 +11,7 @@ import { import { compare } from "./compare"; export function reconcileFunctionName( - future: - | NamedContractCallFuture - | NamedStaticCallFuture, + future: ContractCallFuture | StaticCallFuture, exState: CallExecutionState | StaticCallExecutionState, _context: ReconciliationContext ): ReconciliationFutureResultFailure | undefined { diff --git a/packages/core/src/internal/reconciliation/helpers/reconcile-libraries.ts b/packages/core/src/internal/reconciliation/helpers/reconcile-libraries.ts index eef509e6d..0e26ba6a1 100644 --- a/packages/core/src/internal/reconciliation/helpers/reconcile-libraries.ts +++ b/packages/core/src/internal/reconciliation/helpers/reconcile-libraries.ts @@ -1,8 +1,8 @@ import { - ArtifactContractDeploymentFuture, - ArtifactLibraryDeploymentFuture, - NamedContractDeploymentFuture, - NamedLibraryDeploymentFuture, + ContractDeploymentFuture, + LibraryDeploymentFuture, + NamedArtifactContractDeploymentFuture, + NamedArtifactLibraryDeploymentFuture, } from "../../../types/module"; import { resolveLibraries } from "../../execution/future-processor/helpers/future-resolvers"; import { DeploymentExecutionState } from "../../execution/types/execution-state"; @@ -14,10 +14,10 @@ import { fail } from "../utils"; export function reconcileLibraries( future: - | NamedContractDeploymentFuture - | ArtifactContractDeploymentFuture - | NamedLibraryDeploymentFuture - | ArtifactLibraryDeploymentFuture, + | NamedArtifactContractDeploymentFuture + | ContractDeploymentFuture + | NamedArtifactLibraryDeploymentFuture + | LibraryDeploymentFuture, exState: DeploymentExecutionState, context: ReconciliationContext ): ReconciliationFutureResultFailure | undefined { diff --git a/packages/core/src/internal/reconciliation/helpers/reconcile-value.ts b/packages/core/src/internal/reconciliation/helpers/reconcile-value.ts index a1201b622..67d5e58e3 100644 --- a/packages/core/src/internal/reconciliation/helpers/reconcile-value.ts +++ b/packages/core/src/internal/reconciliation/helpers/reconcile-value.ts @@ -1,7 +1,7 @@ import { - ArtifactContractDeploymentFuture, - NamedContractCallFuture, - NamedContractDeploymentFuture, + ContractDeploymentFuture, + ContractCallFuture, + NamedArtifactContractDeploymentFuture, SendDataFuture, } from "../../../types/module"; import { resolveValue } from "../../execution/future-processor/helpers/future-resolvers"; @@ -19,9 +19,9 @@ import { compare } from "./compare"; export function reconcileValue( future: - | NamedContractDeploymentFuture - | ArtifactContractDeploymentFuture - | NamedContractCallFuture + | NamedArtifactContractDeploymentFuture + | ContractDeploymentFuture + | ContractCallFuture | SendDataFuture, exState: | DeploymentExecutionState diff --git a/packages/core/src/internal/validation/stageOne/validateArtifactContractAt.ts b/packages/core/src/internal/validation/stageOne/validateArtifactContractAt.ts index 6b8ec9487..56917f654 100644 --- a/packages/core/src/internal/validation/stageOne/validateArtifactContractAt.ts +++ b/packages/core/src/internal/validation/stageOne/validateArtifactContractAt.ts @@ -1,8 +1,8 @@ import { ArtifactResolver } from "../../../types/artifact"; -import { ArtifactContractAtFuture } from "../../../types/module"; +import { ContractAtFuture } from "../../../types/module"; export async function validateArtifactContractAt( - _future: ArtifactContractAtFuture, + _future: ContractAtFuture, _artifactLoader: ArtifactResolver ) { return; // no-op diff --git a/packages/core/src/internal/validation/stageOne/validateArtifactContractDeployment.ts b/packages/core/src/internal/validation/stageOne/validateArtifactContractDeployment.ts index ae6d03d45..f98fd9a1f 100644 --- a/packages/core/src/internal/validation/stageOne/validateArtifactContractDeployment.ts +++ b/packages/core/src/internal/validation/stageOne/validateArtifactContractDeployment.ts @@ -1,10 +1,10 @@ import { ArtifactResolver } from "../../../types/artifact"; -import { ArtifactContractDeploymentFuture } from "../../../types/module"; +import { ContractDeploymentFuture } from "../../../types/module"; import { validateContractConstructorArgsLength } from "../../execution/abi"; import { validateLibraryNames } from "../../execution/libraries"; export async function validateArtifactContractDeployment( - future: ArtifactContractDeploymentFuture, + future: ContractDeploymentFuture, _artifactLoader: ArtifactResolver ) { const artifact = future.artifact; diff --git a/packages/core/src/internal/validation/stageOne/validateArtifactLibraryDeployment.ts b/packages/core/src/internal/validation/stageOne/validateArtifactLibraryDeployment.ts index 93fbe7082..54ae6b9f8 100644 --- a/packages/core/src/internal/validation/stageOne/validateArtifactLibraryDeployment.ts +++ b/packages/core/src/internal/validation/stageOne/validateArtifactLibraryDeployment.ts @@ -1,8 +1,8 @@ import { ArtifactResolver } from "../../../types/artifact"; -import { ArtifactLibraryDeploymentFuture } from "../../../types/module"; +import { LibraryDeploymentFuture } from "../../../types/module"; export async function validateArtifactLibraryDeployment( - _future: ArtifactLibraryDeploymentFuture, + _future: LibraryDeploymentFuture, _artifactLoader: ArtifactResolver ) { return; // no-op diff --git a/packages/core/src/internal/validation/stageOne/validateNamedContractAt.ts b/packages/core/src/internal/validation/stageOne/validateNamedContractAt.ts index 4aa4cdc48..48c3a4eee 100644 --- a/packages/core/src/internal/validation/stageOne/validateNamedContractAt.ts +++ b/packages/core/src/internal/validation/stageOne/validateNamedContractAt.ts @@ -1,10 +1,10 @@ import { IgnitionValidationError } from "../../../errors"; import { isArtifactType } from "../../../type-guards"; import { ArtifactResolver } from "../../../types/artifact"; -import { NamedContractAtFuture } from "../../../types/module"; +import { NamedArtifactContractAtFuture } from "../../../types/module"; export async function validateNamedContractAt( - future: NamedContractAtFuture, + future: NamedArtifactContractAtFuture, artifactLoader: ArtifactResolver ) { const artifact = await artifactLoader.loadArtifact(future.contractName); diff --git a/packages/core/src/internal/validation/stageOne/validateNamedContractCall.ts b/packages/core/src/internal/validation/stageOne/validateNamedContractCall.ts index 0095a1986..c5212e7dd 100644 --- a/packages/core/src/internal/validation/stageOne/validateNamedContractCall.ts +++ b/packages/core/src/internal/validation/stageOne/validateNamedContractCall.ts @@ -1,14 +1,14 @@ import { IgnitionValidationError } from "../../../errors"; import { isArtifactType } from "../../../type-guards"; import { ArtifactResolver } from "../../../types/artifact"; -import { NamedContractCallFuture } from "../../../types/module"; +import { ContractCallFuture } from "../../../types/module"; import { validateArtifactFunction, validateArtifactFunctionName, } from "../../execution/abi"; export async function validateNamedContractCall( - future: NamedContractCallFuture, + future: ContractCallFuture, artifactLoader: ArtifactResolver ) { const artifact = diff --git a/packages/core/src/internal/validation/stageOne/validateNamedContractDeployment.ts b/packages/core/src/internal/validation/stageOne/validateNamedContractDeployment.ts index be21bbafd..edf99355d 100644 --- a/packages/core/src/internal/validation/stageOne/validateNamedContractDeployment.ts +++ b/packages/core/src/internal/validation/stageOne/validateNamedContractDeployment.ts @@ -1,12 +1,12 @@ import { IgnitionValidationError } from "../../../errors"; import { isArtifactType } from "../../../type-guards"; import { ArtifactResolver } from "../../../types/artifact"; -import { NamedContractDeploymentFuture } from "../../../types/module"; +import { NamedArtifactContractDeploymentFuture } from "../../../types/module"; import { validateContractConstructorArgsLength } from "../../execution/abi"; import { validateLibraryNames } from "../../execution/libraries"; export async function validateNamedContractDeployment( - future: NamedContractDeploymentFuture, + future: NamedArtifactContractDeploymentFuture, artifactLoader: ArtifactResolver ) { const artifact = await artifactLoader.loadArtifact(future.contractName); diff --git a/packages/core/src/internal/validation/stageOne/validateNamedLibraryDeployment.ts b/packages/core/src/internal/validation/stageOne/validateNamedLibraryDeployment.ts index b477df7c4..1025bc98d 100644 --- a/packages/core/src/internal/validation/stageOne/validateNamedLibraryDeployment.ts +++ b/packages/core/src/internal/validation/stageOne/validateNamedLibraryDeployment.ts @@ -1,11 +1,11 @@ import { IgnitionValidationError } from "../../../errors"; import { isArtifactType } from "../../../type-guards"; import { ArtifactResolver } from "../../../types/artifact"; -import { NamedLibraryDeploymentFuture } from "../../../types/module"; +import { NamedArtifactLibraryDeploymentFuture } from "../../../types/module"; import { validateLibraryNames } from "../../execution/libraries"; export async function validateNamedLibraryDeployment( - future: NamedLibraryDeploymentFuture, + future: NamedArtifactLibraryDeploymentFuture, artifactLoader: ArtifactResolver ) { const artifact = await artifactLoader.loadArtifact(future.contractName); diff --git a/packages/core/src/internal/validation/stageOne/validateNamedStaticCall.ts b/packages/core/src/internal/validation/stageOne/validateNamedStaticCall.ts index 46ababb8d..dec782b6a 100644 --- a/packages/core/src/internal/validation/stageOne/validateNamedStaticCall.ts +++ b/packages/core/src/internal/validation/stageOne/validateNamedStaticCall.ts @@ -1,14 +1,14 @@ import { IgnitionValidationError } from "../../../errors"; import { isArtifactType } from "../../../type-guards"; import { ArtifactResolver } from "../../../types/artifact"; -import { NamedStaticCallFuture } from "../../../types/module"; +import { StaticCallFuture } from "../../../types/module"; import { validateArtifactFunction, validateFunctionArgumentParamType, } from "../../execution/abi"; export async function validateNamedStaticCall( - future: NamedStaticCallFuture, + future: StaticCallFuture, artifactLoader: ArtifactResolver ) { const artifact = diff --git a/packages/core/src/internal/validation/stageTwo/validateArtifactContractAt.ts b/packages/core/src/internal/validation/stageTwo/validateArtifactContractAt.ts index fc65b8081..eeac6e55a 100644 --- a/packages/core/src/internal/validation/stageTwo/validateArtifactContractAt.ts +++ b/packages/core/src/internal/validation/stageTwo/validateArtifactContractAt.ts @@ -2,10 +2,10 @@ import { IgnitionValidationError } from "../../../errors"; import { isModuleParameterRuntimeValue } from "../../../type-guards"; import { ArtifactResolver } from "../../../types/artifact"; import { DeploymentParameters } from "../../../types/deploy"; -import { ArtifactContractAtFuture } from "../../../types/module"; +import { ContractAtFuture } from "../../../types/module"; export async function validateArtifactContractAt( - future: ArtifactContractAtFuture, + future: ContractAtFuture, _artifactLoader: ArtifactResolver, deploymentParameters: DeploymentParameters, _accounts: string[] diff --git a/packages/core/src/internal/validation/stageTwo/validateArtifactContractDeployment.ts b/packages/core/src/internal/validation/stageTwo/validateArtifactContractDeployment.ts index 8f6625d37..4ed1068e2 100644 --- a/packages/core/src/internal/validation/stageTwo/validateArtifactContractDeployment.ts +++ b/packages/core/src/internal/validation/stageTwo/validateArtifactContractDeployment.ts @@ -5,14 +5,14 @@ import { } from "../../../type-guards"; import { ArtifactResolver } from "../../../types/artifact"; import { DeploymentParameters } from "../../../types/deploy"; -import { ArtifactContractDeploymentFuture } from "../../../types/module"; +import { ContractDeploymentFuture } from "../../../types/module"; import { retrieveNestedRuntimeValues, validateAccountRuntimeValue, } from "../utils"; export async function validateArtifactContractDeployment( - future: ArtifactContractDeploymentFuture, + future: ContractDeploymentFuture, _artifactLoader: ArtifactResolver, deploymentParameters: DeploymentParameters, accounts: string[] diff --git a/packages/core/src/internal/validation/stageTwo/validateArtifactLibraryDeployment.ts b/packages/core/src/internal/validation/stageTwo/validateArtifactLibraryDeployment.ts index c1d8ec6a8..ee5c974d4 100644 --- a/packages/core/src/internal/validation/stageTwo/validateArtifactLibraryDeployment.ts +++ b/packages/core/src/internal/validation/stageTwo/validateArtifactLibraryDeployment.ts @@ -1,12 +1,12 @@ import { isAccountRuntimeValue } from "../../../type-guards"; import { ArtifactResolver } from "../../../types/artifact"; import { DeploymentParameters } from "../../../types/deploy"; -import { ArtifactLibraryDeploymentFuture } from "../../../types/module"; +import { LibraryDeploymentFuture } from "../../../types/module"; import { validateLibraryNames } from "../../execution/libraries"; import { validateAccountRuntimeValue } from "../utils"; export async function validateArtifactLibraryDeployment( - future: ArtifactLibraryDeploymentFuture, + future: LibraryDeploymentFuture, _artifactLoader: ArtifactResolver, _deploymentParameters: DeploymentParameters, accounts: string[] diff --git a/packages/core/src/internal/validation/stageTwo/validateNamedContractAt.ts b/packages/core/src/internal/validation/stageTwo/validateNamedContractAt.ts index 587344f2b..1f9c64e9c 100644 --- a/packages/core/src/internal/validation/stageTwo/validateNamedContractAt.ts +++ b/packages/core/src/internal/validation/stageTwo/validateNamedContractAt.ts @@ -2,10 +2,10 @@ import { IgnitionValidationError } from "../../../errors"; import { isModuleParameterRuntimeValue } from "../../../type-guards"; import { ArtifactResolver } from "../../../types/artifact"; import { DeploymentParameters } from "../../../types/deploy"; -import { NamedContractAtFuture } from "../../../types/module"; +import { NamedArtifactContractAtFuture } from "../../../types/module"; export async function validateNamedContractAt( - future: NamedContractAtFuture, + future: NamedArtifactContractAtFuture, _artifactLoader: ArtifactResolver, deploymentParameters: DeploymentParameters, _accounts: string[] diff --git a/packages/core/src/internal/validation/stageTwo/validateNamedContractCall.ts b/packages/core/src/internal/validation/stageTwo/validateNamedContractCall.ts index 18ab152c8..e8cbe454e 100644 --- a/packages/core/src/internal/validation/stageTwo/validateNamedContractCall.ts +++ b/packages/core/src/internal/validation/stageTwo/validateNamedContractCall.ts @@ -5,14 +5,14 @@ import { } from "../../../type-guards"; import { ArtifactResolver } from "../../../types/artifact"; import { DeploymentParameters } from "../../../types/deploy"; -import { NamedContractCallFuture } from "../../../types/module"; +import { ContractCallFuture } from "../../../types/module"; import { retrieveNestedRuntimeValues, validateAccountRuntimeValue, } from "../utils"; export async function validateNamedContractCall( - future: NamedContractCallFuture, + future: ContractCallFuture, _artifactLoader: ArtifactResolver, deploymentParameters: DeploymentParameters, accounts: string[] diff --git a/packages/core/src/internal/validation/stageTwo/validateNamedContractDeployment.ts b/packages/core/src/internal/validation/stageTwo/validateNamedContractDeployment.ts index 20affce6a..f8b76dad8 100644 --- a/packages/core/src/internal/validation/stageTwo/validateNamedContractDeployment.ts +++ b/packages/core/src/internal/validation/stageTwo/validateNamedContractDeployment.ts @@ -5,14 +5,14 @@ import { } from "../../../type-guards"; import { ArtifactResolver } from "../../../types/artifact"; import { DeploymentParameters } from "../../../types/deploy"; -import { NamedContractDeploymentFuture } from "../../../types/module"; +import { NamedArtifactContractDeploymentFuture } from "../../../types/module"; import { retrieveNestedRuntimeValues, validateAccountRuntimeValue, } from "../utils"; export async function validateNamedContractDeployment( - future: NamedContractDeploymentFuture, + future: NamedArtifactContractDeploymentFuture, artifactLoader: ArtifactResolver, deploymentParameters: DeploymentParameters, accounts: string[] diff --git a/packages/core/src/internal/validation/stageTwo/validateNamedLibraryDeployment.ts b/packages/core/src/internal/validation/stageTwo/validateNamedLibraryDeployment.ts index 8787fd30d..705c8e55f 100644 --- a/packages/core/src/internal/validation/stageTwo/validateNamedLibraryDeployment.ts +++ b/packages/core/src/internal/validation/stageTwo/validateNamedLibraryDeployment.ts @@ -1,11 +1,11 @@ import { isAccountRuntimeValue } from "../../../type-guards"; import { ArtifactResolver } from "../../../types/artifact"; import { DeploymentParameters } from "../../../types/deploy"; -import { NamedLibraryDeploymentFuture } from "../../../types/module"; +import { NamedArtifactLibraryDeploymentFuture } from "../../../types/module"; import { validateAccountRuntimeValue } from "../utils"; export async function validateNamedLibraryDeployment( - future: NamedLibraryDeploymentFuture, + future: NamedArtifactLibraryDeploymentFuture, _artifactLoader: ArtifactResolver, _deploymentParameters: DeploymentParameters, accounts: string[] diff --git a/packages/core/src/internal/validation/stageTwo/validateNamedStaticCall.ts b/packages/core/src/internal/validation/stageTwo/validateNamedStaticCall.ts index 093dbb3b0..36becb052 100644 --- a/packages/core/src/internal/validation/stageTwo/validateNamedStaticCall.ts +++ b/packages/core/src/internal/validation/stageTwo/validateNamedStaticCall.ts @@ -5,14 +5,14 @@ import { } from "../../../type-guards"; import { ArtifactResolver } from "../../../types/artifact"; import { DeploymentParameters } from "../../../types/deploy"; -import { NamedStaticCallFuture } from "../../../types/module"; +import { StaticCallFuture } from "../../../types/module"; import { retrieveNestedRuntimeValues, validateAccountRuntimeValue, } from "../utils"; export async function validateNamedStaticCall( - future: NamedStaticCallFuture, + future: StaticCallFuture, _artifactLoader: ArtifactResolver, deploymentParameters: DeploymentParameters, accounts: string[] diff --git a/packages/core/src/stored-deployment-serializer.ts b/packages/core/src/stored-deployment-serializer.ts index 6c933ea8e..70fe5ae6f 100644 --- a/packages/core/src/stored-deployment-serializer.ts +++ b/packages/core/src/stored-deployment-serializer.ts @@ -29,7 +29,7 @@ import { AccountRuntimeValue, AddressResolvableFuture, ArgumentType, - ArtifactContractDeploymentFuture, + ContractDeploymentFuture, ContractFuture, Future, FutureType, @@ -37,8 +37,8 @@ import { IgnitionModuleResult, ModuleParameterRuntimeValue, ModuleParameterType, - NamedContractCallFuture, - NamedContractDeploymentFuture, + ContractCallFuture, + NamedArtifactContractDeploymentFuture, RuntimeValueType, } from "./types/module"; import { @@ -793,9 +793,9 @@ export class StoredDeploymentDeserializer { futuresLookup, serializedFuture.futureToReadFrom.futureId ) as - | NamedContractDeploymentFuture - | ArtifactContractDeploymentFuture - | NamedContractCallFuture, + | NamedArtifactContractDeploymentFuture + | ContractDeploymentFuture + | ContractCallFuture, serializedFuture.eventName, serializedFuture.nameOrIndex, this._lookup( diff --git a/packages/core/src/type-guards.ts b/packages/core/src/type-guards.ts index 7e468fde1..eec1dc584 100644 --- a/packages/core/src/type-guards.ts +++ b/packages/core/src/type-guards.ts @@ -2,9 +2,9 @@ import { Artifact } from "./types/artifact"; import { AccountRuntimeValue, AddressResolvableFuture, - ArtifactContractAtFuture, - ArtifactContractDeploymentFuture, - ArtifactLibraryDeploymentFuture, + ContractAtFuture, + ContractDeploymentFuture, + LibraryDeploymentFuture, CallableContractFuture, ContractFuture, DeploymentFuture, @@ -12,10 +12,10 @@ import { Future, FutureType, ModuleParameterRuntimeValue, - NamedContractAtFuture, - NamedContractDeploymentFuture, - NamedLibraryDeploymentFuture, - NamedStaticCallFuture, + NamedArtifactContractAtFuture, + NamedArtifactContractDeploymentFuture, + NamedArtifactLibraryDeploymentFuture, + StaticCallFuture, ReadEventArgumentFuture, RuntimeValue, RuntimeValueType, @@ -159,7 +159,7 @@ export function isFunctionCallFuture( */ export function isNamedStaticCallFuture( future: Future -): future is NamedStaticCallFuture { +): future is StaticCallFuture { return future.type === FutureType.STATIC_CALL; } @@ -170,7 +170,7 @@ export function isNamedStaticCallFuture( */ export function isReadEventArgumentFuture( future: Future -): future is NamedStaticCallFuture { +): future is StaticCallFuture { return future.type === FutureType.READ_EVENT_ARGUMENT; } @@ -181,7 +181,7 @@ export function isReadEventArgumentFuture( */ export function isNamedContractDeploymentFuture( future: Future -): future is NamedContractDeploymentFuture { +): future is NamedArtifactContractDeploymentFuture { return future.type === FutureType.NAMED_ARTIFACT_CONTRACT_DEPLOYMENT; } @@ -192,7 +192,7 @@ export function isNamedContractDeploymentFuture( */ export function isArtifactContractDeploymentFuture( future: Future -): future is ArtifactContractDeploymentFuture { +): future is ContractDeploymentFuture { return future.type === FutureType.CONTRACT_DEPLOYMENT; } @@ -203,7 +203,7 @@ export function isArtifactContractDeploymentFuture( */ export function isNamedLibraryDeploymentFuture( future: Future -): future is NamedLibraryDeploymentFuture { +): future is NamedArtifactLibraryDeploymentFuture { return future.type === FutureType.NAMED_ARTIFACT_LIBRARY_DEPLOYMENT; } @@ -214,7 +214,7 @@ export function isNamedLibraryDeploymentFuture( */ export function isArtifactLibraryDeploymentFuture( future: Future -): future is ArtifactLibraryDeploymentFuture { +): future is LibraryDeploymentFuture { return future.type === FutureType.LIBRARY_DEPLOYMENT; } @@ -225,7 +225,7 @@ export function isArtifactLibraryDeploymentFuture( */ export function isNamedContractAtFuture( future: Future -): future is NamedContractAtFuture { +): future is NamedArtifactContractAtFuture { return future.type === FutureType.NAMED_ARTIFACT_CONTRACT_AT; } @@ -236,7 +236,7 @@ export function isNamedContractAtFuture( */ export function isArtifactContractAtFuture( future: Future -): future is ArtifactContractAtFuture { +): future is ContractAtFuture { return future.type === FutureType.CONTRACT_AT; } @@ -282,12 +282,12 @@ export function isFutureThatSubmitsOnchainTransaction( ): f is Exclude< Exclude< Exclude< - Exclude>, + Exclude>, ReadEventArgumentFuture >, - NamedContractAtFuture + NamedArtifactContractAtFuture >, - ArtifactContractAtFuture + ContractAtFuture > { return ( !isNamedStaticCallFuture(f) && diff --git a/packages/core/src/types/module-builder.ts b/packages/core/src/types/module-builder.ts index ee3d647d1..b24d5fea2 100644 --- a/packages/core/src/types/module-builder.ts +++ b/packages/core/src/types/module-builder.ts @@ -3,9 +3,9 @@ import { AccountRuntimeValue, AddressResolvableFuture, ArgumentType, - ArtifactContractAtFuture, - ArtifactContractDeploymentFuture, - ArtifactLibraryDeploymentFuture, + ContractAtFuture, + ContractDeploymentFuture, + LibraryDeploymentFuture, CallableContractFuture, ContractFuture, Future, @@ -13,11 +13,11 @@ import { IgnitionModuleResult, ModuleParameterRuntimeValue, ModuleParameterType, - NamedContractAtFuture, - NamedContractCallFuture, - NamedContractDeploymentFuture, - NamedLibraryDeploymentFuture, - NamedStaticCallFuture, + NamedArtifactContractAtFuture, + ContractCallFuture, + NamedArtifactContractDeploymentFuture, + NamedArtifactLibraryDeploymentFuture, + StaticCallFuture, ReadEventArgumentFuture, SendDataFuture, } from "./module"; @@ -131,32 +131,32 @@ export interface IgnitionModuleBuilder { contractName: ContractNameT, args?: ArgumentType[], options?: ContractOptions - ): NamedContractDeploymentFuture; + ): NamedArtifactContractDeploymentFuture; contract( contractName: string, artifact: Artifact, args?: ArgumentType[], options?: ContractOptions - ): ArtifactContractDeploymentFuture; + ): ContractDeploymentFuture; library( libraryName: LibraryNameT, options?: LibraryOptions - ): NamedLibraryDeploymentFuture; + ): NamedArtifactLibraryDeploymentFuture; library( libraryName: string, artifact: Artifact, options?: LibraryOptions - ): ArtifactLibraryDeploymentFuture; + ): LibraryDeploymentFuture; call( contractFuture: CallableContractFuture, functionName: FunctionNameT, args?: ArgumentType[], options?: CallOptions - ): NamedContractCallFuture; + ): ContractCallFuture; staticCall( contractFuture: CallableContractFuture, @@ -164,7 +164,7 @@ export interface IgnitionModuleBuilder { args?: ArgumentType[], nameOrIndex?: string | number, options?: StaticCallOptions - ): NamedStaticCallFuture; + ): StaticCallFuture; contractAt( contractName: ContractNameT, @@ -173,7 +173,7 @@ export interface IgnitionModuleBuilder { | AddressResolvableFuture | ModuleParameterRuntimeValue, options?: ContractAtOptions - ): NamedContractAtFuture; + ): NamedArtifactContractAtFuture; contractAt( contractName: string, @@ -183,14 +183,14 @@ export interface IgnitionModuleBuilder { | ModuleParameterRuntimeValue, artifact: Artifact, options?: ContractAtOptions - ): ArtifactContractAtFuture; + ): ContractAtFuture; readEventArgument( futureToReadFrom: - | NamedContractDeploymentFuture - | ArtifactContractDeploymentFuture + | NamedArtifactContractDeploymentFuture + | ContractDeploymentFuture | SendDataFuture - | NamedContractCallFuture, + | ContractCallFuture, eventName: string, nameOrIndex: string | number, options?: ReadEventArgumentOptions diff --git a/packages/core/src/types/module.ts b/packages/core/src/types/module.ts index a3132543f..70b45a490 100644 --- a/packages/core/src/types/module.ts +++ b/packages/core/src/types/module.ts @@ -12,7 +12,7 @@ export type BaseArgumentType = | string | boolean | ContractFuture - | NamedStaticCallFuture + | StaticCallFuture | ReadEventArgumentFuture | RuntimeValue; @@ -50,14 +50,14 @@ export enum FutureType { * @beta */ export type Future = - | NamedContractDeploymentFuture - | ArtifactContractDeploymentFuture - | NamedLibraryDeploymentFuture - | ArtifactLibraryDeploymentFuture - | NamedContractCallFuture - | NamedStaticCallFuture - | NamedContractAtFuture - | ArtifactContractAtFuture + | NamedArtifactContractDeploymentFuture + | ContractDeploymentFuture + | NamedArtifactLibraryDeploymentFuture + | LibraryDeploymentFuture + | ContractCallFuture + | StaticCallFuture + | NamedArtifactContractAtFuture + | ContractAtFuture | ReadEventArgumentFuture | SendDataFuture; @@ -68,12 +68,12 @@ export type Future = * @beta */ export type ContractFuture = - | NamedContractDeploymentFuture - | ArtifactContractDeploymentFuture - | NamedLibraryDeploymentFuture - | ArtifactLibraryDeploymentFuture - | NamedContractAtFuture - | ArtifactContractAtFuture; + | NamedArtifactContractDeploymentFuture + | ContractDeploymentFuture + | NamedArtifactLibraryDeploymentFuture + | LibraryDeploymentFuture + | NamedArtifactContractAtFuture + | ContractAtFuture; /** * A future representing only contracts that can be called off-chain (i.e. not libraries). @@ -82,10 +82,10 @@ export type ContractFuture = * @beta */ export type CallableContractFuture = - | NamedContractDeploymentFuture - | ArtifactContractDeploymentFuture - | NamedContractAtFuture - | ArtifactContractAtFuture; + | NamedArtifactContractDeploymentFuture + | ContractDeploymentFuture + | NamedArtifactContractAtFuture + | ContractAtFuture; /** * A future representing a deployment. @@ -93,10 +93,10 @@ export type CallableContractFuture = * @beta */ export type DeploymentFuture = - | NamedContractDeploymentFuture - | ArtifactContractDeploymentFuture - | NamedLibraryDeploymentFuture - | ArtifactLibraryDeploymentFuture; + | NamedArtifactContractDeploymentFuture + | ContractDeploymentFuture + | NamedArtifactLibraryDeploymentFuture + | LibraryDeploymentFuture; /** * A future representing a call. Either a static one or one that modifies contract state @@ -107,8 +107,8 @@ export type FunctionCallFuture< ContractNameT extends string, FunctionNameT extends string > = - | NamedContractCallFuture - | NamedStaticCallFuture; + | ContractCallFuture + | StaticCallFuture; /** * A future that can be resolved to a standard Ethereum address. @@ -117,7 +117,7 @@ export type FunctionCallFuture< */ export type AddressResolvableFuture = | ContractFuture - | NamedStaticCallFuture + | StaticCallFuture | ReadEventArgumentFuture; /** @@ -125,7 +125,9 @@ export type AddressResolvableFuture = * * @beta */ -export interface NamedContractDeploymentFuture { +export interface NamedArtifactContractDeploymentFuture< + ContractNameT extends string +> { type: FutureType.NAMED_ARTIFACT_CONTRACT_DEPLOYMENT; id: string; module: IgnitionModule; @@ -143,7 +145,7 @@ export interface NamedContractDeploymentFuture { * * @beta */ -export interface ArtifactContractDeploymentFuture { +export interface ContractDeploymentFuture { type: FutureType.CONTRACT_DEPLOYMENT; id: string; module: IgnitionModule; @@ -161,7 +163,9 @@ export interface ArtifactContractDeploymentFuture { * * @beta */ -export interface NamedLibraryDeploymentFuture { +export interface NamedArtifactLibraryDeploymentFuture< + LibraryNameT extends string +> { type: FutureType.NAMED_ARTIFACT_LIBRARY_DEPLOYMENT; id: string; module: IgnitionModule; @@ -177,7 +181,7 @@ export interface NamedLibraryDeploymentFuture { * * @beta */ -export interface ArtifactLibraryDeploymentFuture { +export interface LibraryDeploymentFuture { type: FutureType.LIBRARY_DEPLOYMENT; id: string; module: IgnitionModule; @@ -193,7 +197,7 @@ export interface ArtifactLibraryDeploymentFuture { * * @beta */ -export interface NamedContractCallFuture< +export interface ContractCallFuture< ContractNameT extends string, FunctionNameT extends string > { @@ -213,7 +217,7 @@ export interface NamedContractCallFuture< * * @beta */ -export interface NamedStaticCallFuture< +export interface StaticCallFuture< ContractNameT extends string, FunctionNameT extends string > { @@ -233,7 +237,7 @@ export interface NamedStaticCallFuture< * * @beta */ -export interface NamedContractAtFuture { +export interface NamedArtifactContractAtFuture { type: FutureType.NAMED_ARTIFACT_CONTRACT_AT; id: string; module: IgnitionModule; @@ -251,7 +255,7 @@ export interface NamedContractAtFuture { * * @beta */ -export interface ArtifactContractAtFuture { +export interface ContractAtFuture { type: FutureType.CONTRACT_AT; id: string; module: IgnitionModule; @@ -276,10 +280,10 @@ export interface ReadEventArgumentFuture { module: IgnitionModule; dependencies: Set; futureToReadFrom: - | NamedContractDeploymentFuture - | ArtifactContractDeploymentFuture + | NamedArtifactContractDeploymentFuture + | ContractDeploymentFuture | SendDataFuture - | NamedContractCallFuture; + | ContractCallFuture; eventName: string; nameOrIndex: string | number; emitter: ContractFuture; diff --git a/packages/core/test/execution/future-processor/helpers/build-initialize-message-for.ts b/packages/core/test/execution/future-processor/helpers/build-initialize-message-for.ts index ceb94ed84..a5c0a72de 100644 --- a/packages/core/test/execution/future-processor/helpers/build-initialize-message-for.ts +++ b/packages/core/test/execution/future-processor/helpers/build-initialize-message-for.ts @@ -46,15 +46,15 @@ import { SendDataFutureImplementation, } from "../../../../src/internal/module"; import { - ArtifactContractAtFuture, - ArtifactContractDeploymentFuture, - ArtifactLibraryDeploymentFuture, + ContractAtFuture, + ContractDeploymentFuture, + LibraryDeploymentFuture, FutureType, - NamedContractAtFuture, - NamedContractCallFuture, - NamedContractDeploymentFuture, - NamedLibraryDeploymentFuture, - NamedStaticCallFuture, + NamedArtifactContractAtFuture, + ContractCallFuture, + NamedArtifactContractDeploymentFuture, + NamedArtifactLibraryDeploymentFuture, + StaticCallFuture, ReadEventArgumentFuture, SendDataFuture, } from "../../../../src/types/module"; @@ -69,16 +69,16 @@ describe("buildInitializeMessageFor", () => { const libraryAddress = "0x742d35Cc6634C0532925a3b844Bc454e4438f44e"; const basicStrategy = { name: "basic" } as any; - let namedContractDeployment: NamedContractDeploymentFuture; - let anotherNamedContractDeployment: NamedContractDeploymentFuture; - let safeMathLibraryDeployment: NamedLibraryDeploymentFuture; - let artifactContractDeployment: ArtifactContractDeploymentFuture; - let namedLibraryDeployment: NamedLibraryDeploymentFuture; - let artifactLibraryDeployment: ArtifactLibraryDeploymentFuture; - let namedContractCall: NamedContractCallFuture; - let staticCall: NamedStaticCallFuture; - let namedContractAt: NamedContractAtFuture; - let artifactContractAt: ArtifactContractAtFuture; + let namedContractDeployment: NamedArtifactContractDeploymentFuture; + let anotherNamedContractDeployment: NamedArtifactContractDeploymentFuture; + let safeMathLibraryDeployment: NamedArtifactLibraryDeploymentFuture; + let artifactContractDeployment: ContractDeploymentFuture; + let namedLibraryDeployment: NamedArtifactLibraryDeploymentFuture; + let artifactLibraryDeployment: LibraryDeploymentFuture; + let namedContractCall: ContractCallFuture; + let staticCall: StaticCallFuture; + let namedContractAt: NamedArtifactContractAtFuture; + let artifactContractAt: ContractAtFuture; let readEventArgument: ReadEventArgumentFuture; let sendData: SendDataFuture; diff --git a/packages/core/test/execution/future-processor/named-contract-deploy.ts b/packages/core/test/execution/future-processor/named-contract-deploy.ts index bada0eef6..8f82a9ccf 100644 --- a/packages/core/test/execution/future-processor/named-contract-deploy.ts +++ b/packages/core/test/execution/future-processor/named-contract-deploy.ts @@ -1,6 +1,6 @@ import { assert } from "chai"; -import { NamedContractDeploymentFuture } from "../../../src"; +import { NamedArtifactContractDeploymentFuture } from "../../../src"; import { TransactionParams } from "../../../src/internal/execution/jsonrpc-client"; import { deploymentStateReducer } from "../../../src/internal/execution/reducers/deployment-state-reducer"; import { ExecutionResultType } from "../../../src/internal/execution/types/execution-result"; @@ -27,7 +27,7 @@ describe("future processor", () => { // Arrange const fakeModule = {} as any; - const deploymentFuture: NamedContractDeploymentFuture = + const deploymentFuture: NamedArtifactContractDeploymentFuture = new NamedContractDeploymentFutureImplementation( "MyModule:TestContract", fakeModule, diff --git a/packages/hardhat-plugin/src/ignition-helper.ts b/packages/hardhat-plugin/src/ignition-helper.ts index a44806da0..ead8e254c 100644 --- a/packages/hardhat-plugin/src/ignition-helper.ts +++ b/packages/hardhat-plugin/src/ignition-helper.ts @@ -11,8 +11,8 @@ import { IgnitionModule, IgnitionModuleResult, isContractFuture, - NamedContractAtFuture, - NamedContractDeploymentFuture, + NamedArtifactContractAtFuture, + NamedArtifactContractDeploymentFuture, SuccessfulDeploymentResult, } from "@ignored/ignition-core"; import { HardhatPluginError } from "hardhat/plugins"; @@ -157,8 +157,8 @@ export type IgnitionModuleResultsTToEthersContracts< IgnitionModuleResultsT extends IgnitionModuleResult > = { [contract in keyof IgnitionModuleResultsT]: IgnitionModuleResultsT[contract] extends - | NamedContractDeploymentFuture - | NamedContractAtFuture + | NamedArtifactContractDeploymentFuture + | NamedArtifactContractAtFuture ? TypeChainEthersContractByName : Contract; };