@nomicfoundation/ignition-core
Advanced tools
Comparing version 0.11.0-rc.4 to 0.11.0-rc.5
@@ -24,2 +24,9 @@ import type { IgnitionModule, IgnitionModuleResult } from "../types/module"; | ||
private _getDeploymentResult; | ||
/** | ||
* Fetches the existing deployment state or initializes a new one. | ||
* | ||
* @returns An object with the deployment state and a boolean indicating | ||
* if the deployment is being resumed (i.e. the deployment state is not | ||
* new). | ||
*/ | ||
private _getOrInitializeDeploymentState; | ||
@@ -26,0 +33,0 @@ private _emitDeploymentStartEvent; |
@@ -42,4 +42,6 @@ "use strict"; | ||
async deploy(ignitionModule, deploymentParameters, accounts, defaultSender) { | ||
let deploymentState = await this._getOrInitializeDeploymentState(); | ||
this._emitDeploymentStartEvent(ignitionModule.id, this._deploymentDir); | ||
const deployment = await this._getOrInitializeDeploymentState(); | ||
const isResumed = deployment.isResumed; | ||
let deploymentState = deployment.deploymentState; | ||
this._emitDeploymentStartEvent(ignitionModule.id, this._deploymentDir, isResumed); | ||
const contracts = (0, get_futures_from_module_1.getFuturesFromModule)(ignitionModule).filter(type_guards_1.isContractFuture); | ||
@@ -109,2 +111,9 @@ const contractStates = contracts | ||
} | ||
/** | ||
* Fetches the existing deployment state or initializes a new one. | ||
* | ||
* @returns An object with the deployment state and a boolean indicating | ||
* if the deployment is being resumed (i.e. the deployment state is not | ||
* new). | ||
*/ | ||
async _getOrInitializeDeploymentState() { | ||
@@ -114,3 +123,4 @@ const chainId = await this._jsonRpcClient.getChainId(); | ||
if (deploymentState === undefined) { | ||
return (0, deployment_state_helpers_1.initializeDeploymentState)(chainId, this._deploymentLoader); | ||
const newState = await (0, deployment_state_helpers_1.initializeDeploymentState)(chainId, this._deploymentLoader); | ||
return { deploymentState: newState, isResumed: false }; | ||
} | ||
@@ -125,5 +135,5 @@ // TODO: this should be moved out, it is not obvious that a significant | ||
} | ||
return deploymentState; | ||
return { deploymentState, isResumed: true }; | ||
} | ||
_emitDeploymentStartEvent(moduleId, deploymentDir) { | ||
_emitDeploymentStartEvent(moduleId, deploymentDir, isResumed) { | ||
if (this._executionEventListener === undefined) { | ||
@@ -136,2 +146,3 @@ return; | ||
deploymentDir: deploymentDir ?? undefined, | ||
isResumed, | ||
}); | ||
@@ -138,0 +149,0 @@ } |
@@ -52,2 +52,3 @@ import { DeploymentResult } from "./deploy"; | ||
deploymentDir: string | undefined; | ||
isResumed: boolean; | ||
} | ||
@@ -54,0 +55,0 @@ /** |
{ | ||
"name": "@nomicfoundation/ignition-core", | ||
"version": "0.11.0-rc.4", | ||
"version": "0.11.0-rc.5", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "author": "Nomic Foundation", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15556
1108899
571