Merge pull request #841 from embark-framework/fix_deploy_if

fix dashboard state so it doesn't show pending due to deployIf
This commit is contained in:
Iuri Matias 2018-09-17 13:22:42 -04:00 committed by GitHub
commit 2eb4334a63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -143,7 +143,7 @@ class ContractDeployer {
self.plugins.emitAndRunActionsForEvent('deploy:contract:shouldDeploy', {contract: contract, shouldDeploy: true}, function(_err, params) {
let trackedContract = params.contract;
if (!params.shouldDeploy) {
return next();
return self.willNotDeployContract(contract, trackedContract, next);
}
if (!trackedContract.address) {
return self.deployContract(contract, next);
@ -161,6 +161,12 @@ class ContractDeployer {
], callback);
}
willNotDeployContract(contract, trackedContract, callback) {
contract.deploy = false;
this.events.emit("deploy:contract:undeployed", contract);
callback();
}
contractAlreadyDeployed(contract, trackedContract, callback) {
const self = this;
this.logFunction(contract)(contract.className.bold.cyan + __(" already deployed at ").green + trackedContract.address.bold.cyan);

View File

@ -53,7 +53,7 @@ module.exports = {
}
},
SomeContract: {
deployIf: 'MyToken.methods.isAvailable().call()',
deployIf: 'await MyToken.methods.isAvailable().call()',
args: [
["$MyToken2", "$SimpleStorage"],
100