mirror of
https://github.com/embarklabs/embark.git
synced 2025-02-16 23:57:11 +00:00
fix(@embark/embark-deployment): Undeployed contract artifacts (#1815)
Contract artifacts were not being generated nor run through the VM if the contracts/interfaces were not deployed. These features were executed as actions on the `deployment:contract:deployed` event. This PR runs executes the same actions for `deployment:contract:undeployed` event as the `deployment:contract:deployed` event, which occurs when a contract is not deployed.
This commit is contained in:
parent
0455c550ce
commit
0c7c3e83fe
@ -32,8 +32,9 @@ class ContractDeployer {
|
|||||||
(params, next) => {
|
(params, next) => {
|
||||||
|
|
||||||
if (!params.shouldDeploy) {
|
if (!params.shouldDeploy) {
|
||||||
this.events.emit("deployment:contract:undeployed", contract);
|
return this.plugins.emitAndRunActionsForEvent('deployment:contract:undeployed', {contract}, (err, _params) => {
|
||||||
return next(null, null);
|
next(err, null);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: implement `blockchainType` a la `this.deployer[contract.blockchainType].apply(this.deployer, [contract, next])`
|
// TODO: implement `blockchainType` a la `this.deployer[contract.blockchainType].apply(this.deployer, [contract, next])`
|
||||||
|
@ -25,9 +25,11 @@ class EmbarkWeb3 {
|
|||||||
this.events.on("blockchain:started", this.registerWeb3Object.bind(this));
|
this.events.on("blockchain:started", this.registerWeb3Object.bind(this));
|
||||||
embark.registerActionForEvent("pipeline:generateAll:before", this.addWeb3Artifact.bind(this));
|
embark.registerActionForEvent("pipeline:generateAll:before", this.addWeb3Artifact.bind(this));
|
||||||
embark.registerActionForEvent("deployment:contract:deployed", this.registerInVm.bind(this));
|
embark.registerActionForEvent("deployment:contract:deployed", this.registerInVm.bind(this));
|
||||||
|
embark.registerActionForEvent("deployment:contract:undeployed", this.registerInVm.bind(this));
|
||||||
embark.registerActionForEvent("deployment:contract:deployed", this.registerArtifact.bind(this));
|
embark.registerActionForEvent("deployment:contract:deployed", this.registerArtifact.bind(this));
|
||||||
|
embark.registerActionForEvent("deployment:contract:undeployed", this.registerArtifact.bind(this));
|
||||||
|
|
||||||
this.registerWeb3Help()
|
this.registerWeb3Help();
|
||||||
}
|
}
|
||||||
|
|
||||||
async registerWeb3Object() {
|
async registerWeb3Object() {
|
||||||
|
@ -69,7 +69,14 @@ class Dashboard {
|
|||||||
this.events.on("deployment:contract:deployed", (_contract) => {
|
this.events.on("deployment:contract:deployed", (_contract) => {
|
||||||
// self.events.emit('contractsState', self.contractsState());
|
// self.events.emit('contractsState', self.contractsState());
|
||||||
this.events.request("contracts:state", (err, contracts) => {
|
this.events.request("contracts:state", (err, contracts) => {
|
||||||
monitor.setContracts(contracts)
|
monitor.setContracts(contracts);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
this.events.on("deployment:contract:undeployed", (_contract) => {
|
||||||
|
// self.events.emit('contractsState', self.contractsState());
|
||||||
|
this.events.request("contracts:state", (err, contracts) => {
|
||||||
|
monitor.setContracts(contracts);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ class EthereumBlockchainClient {
|
|||||||
this.events = embark.events;
|
this.events = embark.events;
|
||||||
this.logger = embark.logger;
|
this.logger = embark.logger;
|
||||||
|
|
||||||
|
this.embark.registerActionForEvent("deployment:contract:undeployed", this.addContractJSONToPipeline.bind(this));
|
||||||
this.embark.registerActionForEvent("deployment:contract:deployed", this.addContractJSONToPipeline.bind(this));
|
this.embark.registerActionForEvent("deployment:contract:deployed", this.addContractJSONToPipeline.bind(this));
|
||||||
this.embark.registerActionForEvent('deployment:contract:beforeDeploy', this.determineArguments.bind(this));
|
this.embark.registerActionForEvent('deployment:contract:beforeDeploy', this.determineArguments.bind(this));
|
||||||
this.embark.registerActionForEvent('deployment:contract:beforeDeploy', this.doLinking.bind(this));
|
this.embark.registerActionForEvent('deployment:contract:beforeDeploy', this.doLinking.bind(this));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user