simplify method dealing with instanceOf
This commit is contained in:
parent
5c283b5232
commit
99c528c230
|
@ -80,18 +80,21 @@ ContractsManager.prototype.build = function(done) {
|
||||||
}
|
}
|
||||||
callback();
|
callback();
|
||||||
},
|
},
|
||||||
|
function setDeployIntention(callback) {
|
||||||
|
var className, contract;
|
||||||
|
for(className in self.contracts) {
|
||||||
|
contract = self.contracts[className];
|
||||||
|
contract.deploy = (contract.deploy === undefined) || contract.deploy;
|
||||||
|
}
|
||||||
|
},
|
||||||
function dealWithSpecialConfigs(callback) {
|
function dealWithSpecialConfigs(callback) {
|
||||||
var className, contract, parentContractName, parentContract;
|
var className, contract, parentContractName, parentContract;
|
||||||
|
|
||||||
for(className in self.contracts) {
|
for(className in self.contracts) {
|
||||||
contract = self.contracts[className];
|
contract = self.contracts[className];
|
||||||
|
|
||||||
// if deploy intention is not specified default is true
|
if (contract.instanceOf === undefined) { continue; }
|
||||||
if (contract.deploy === undefined) {
|
|
||||||
contract.deploy = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (contract.instanceOf !== undefined) {
|
|
||||||
parentContractName = contract.instanceOf;
|
parentContractName = contract.instanceOf;
|
||||||
parentContract = self.contracts[parentContractName];
|
parentContract = self.contracts[parentContractName];
|
||||||
|
|
||||||
|
@ -101,7 +104,7 @@ ContractsManager.prototype.build = function(done) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parentContract === undefined) {
|
if (parentContract === undefined) {
|
||||||
slef.logger.error(className + ": couldn't find instanceOf contract " + parentContractName);
|
self.logger.error(className + ": couldn't find instanceOf contract " + parentContractName);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,7 +124,7 @@ ContractsManager.prototype.build = function(done) {
|
||||||
|
|
||||||
contract.gas = contract.gas || parentContract.gas;
|
contract.gas = contract.gas || parentContract.gas;
|
||||||
contract.gasPrice = contract.gasPrice || parentContract.gasPrice;
|
contract.gasPrice = contract.gasPrice || parentContract.gasPrice;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
callback();
|
callback();
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue