diff --git a/lib/contracts/blockchain.js b/lib/contracts/blockchain.js index 3ccee4003..79a000bc6 100644 --- a/lib/contracts/blockchain.js +++ b/lib/contracts/blockchain.js @@ -82,6 +82,10 @@ class Blockchain { this.web3.eth.getAccounts(cb); } + getCode(address, cb) { + this.web3.eth.getCode(address, cb); + } + } module.exports = Blockchain; diff --git a/lib/contracts/deploy.js b/lib/contracts/deploy.js index 0d690230b..2ddc8d4ca 100644 --- a/lib/contracts/deploy.js +++ b/lib/contracts/deploy.js @@ -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 {