mirror of https://github.com/embarklabs/embark.git
fix dashboard state so it doesn't show pending for contracts that were not deployed due to deployIf directive
This commit is contained in:
parent
a43627de5b
commit
32a1ba0f32
|
@ -143,7 +143,7 @@ class ContractDeployer {
|
||||||
self.plugins.emitAndRunActionsForEvent('deploy:contract:shouldDeploy', {contract: contract, shouldDeploy: true}, function(_err, params) {
|
self.plugins.emitAndRunActionsForEvent('deploy:contract:shouldDeploy', {contract: contract, shouldDeploy: true}, function(_err, params) {
|
||||||
let trackedContract = params.contract;
|
let trackedContract = params.contract;
|
||||||
if (!params.shouldDeploy) {
|
if (!params.shouldDeploy) {
|
||||||
return next();
|
return self.willNotDeployContract(contract, trackedContract, next);
|
||||||
}
|
}
|
||||||
if (!trackedContract.address) {
|
if (!trackedContract.address) {
|
||||||
return self.deployContract(contract, next);
|
return self.deployContract(contract, next);
|
||||||
|
@ -161,6 +161,12 @@ class ContractDeployer {
|
||||||
], callback);
|
], callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
willNotDeployContract(contract, trackedContract, callback) {
|
||||||
|
contract.deploy = false;
|
||||||
|
this.events.emit("deploy:contract:undeployed", contract);
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
|
||||||
contractAlreadyDeployed(contract, trackedContract, callback) {
|
contractAlreadyDeployed(contract, trackedContract, callback) {
|
||||||
const self = this;
|
const self = this;
|
||||||
this.logFunction(contract)(contract.className.bold.cyan + __(" already deployed at ").green + trackedContract.address.bold.cyan);
|
this.logFunction(contract)(contract.className.bold.cyan + __(" already deployed at ").green + trackedContract.address.bold.cyan);
|
||||||
|
|
|
@ -53,7 +53,7 @@ module.exports = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
SomeContract: {
|
SomeContract: {
|
||||||
deployIf: 'MyToken.methods.isAvailable().call()',
|
deployIf: 'await MyToken.methods.isAvailable().call()',
|
||||||
args: [
|
args: [
|
||||||
["$MyToken2", "$SimpleStorage"],
|
["$MyToken2", "$SimpleStorage"],
|
||||||
100
|
100
|
||||||
|
|
Loading…
Reference in New Issue