From 1547a115a4dbbccfed624d9d1e49899e7d4598e8 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Fri, 18 May 2018 18:41:04 -0400 Subject: [PATCH] move getCode to blockchain --- lib/contracts/blockchain.js | 4 ++++ lib/contracts/deploy.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) 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 {