move getCode to blockchain

This commit is contained in:
Iuri Matias 2018-05-18 18:41:04 -04:00 committed by Jonathan Rainville
parent ae93d78cc2
commit 1547a115a4
2 changed files with 5 additions and 1 deletions

View File

@ -82,6 +82,10 @@ class Blockchain {
this.web3.eth.getAccounts(cb);
}
getCode(address, cb) {
this.web3.eth.getCode(address, cb);
}
}
module.exports = Blockchain;

View File

@ -115,7 +115,7 @@ class Deploy {
return self.contractToDeploy(contract, params, callback);
}
this.web3.eth.getCode(trackedContract.address, function(_getCodeErr, codeInChain) {
this.blockchain.getCode(trackedContract.address, function(_getCodeErr, codeInChain) {
if (codeInChain !== "0x") {
self.contractAlreadyDeployed(contract, trackedContract, callback);
} else {