contract_deployer: Redeploy if track field is set to false.

Always deploy the contract regardless if already deployed
when 'track' field in the contract configuration is specified
and set to false.

In line with #938 requirements:

* If a contract has the track field set to false, that contract
  will always deploy.
* If the track field is set to true, then the existing deployment
  tracking mechanism will be active for that contract.
* If the field is not set, it should be assumed to true by default

Refs: https://github.com/embark-framework/embark/issues/938
This commit is contained in:
Cryptomental 2018-10-05 09:54:24 +02:00
parent bfd0118e65
commit 701b25e5e7

View File

@ -150,6 +150,11 @@ class ContractDeployer {
if (!trackedContract.address) {
return self.deployContract(contract, next);
}
// deploy the contract regardless if track field is defined and set to false
if (trackedContract.track === false) {
self.logFunction(contract)(contract.className.bold.cyan + __(" will be redeployed").green);
return self.deployContract(contract, next);
}
self.blockchain.getCode(trackedContract.address, function(_getCodeErr, codeInChain) {
if (codeInChain !== "0x") {