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) {
|
||||
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);
|
||||
|
|
|
@ -53,7 +53,7 @@ module.exports = {
|
|||
}
|
||||
},
|
||||
SomeContract: {
|
||||
deployIf: 'MyToken.methods.isAvailable().call()',
|
||||
deployIf: 'await MyToken.methods.isAvailable().call()',
|
||||
args: [
|
||||
["$MyToken2", "$SimpleStorage"],
|
||||
100
|
||||
|
|
Loading…
Reference in New Issue