move Contract object to blockchain module

This commit is contained in:
Iuri Matias 2018-05-18 19:00:36 -04:00 committed by Jonathan Rainville
parent 84dcfca254
commit 9b1a78cdaa
2 changed files with 5 additions and 1 deletions

View File

@ -90,6 +90,10 @@ class Blockchain {
this.web3.eth.getBlock(blockNumber, cb);
}
ContractObject(params) {
return new this.web3.eth.Contract(params.abi);
}
}
module.exports = Blockchain;

View File

@ -308,7 +308,7 @@ class Deploy {
});
},
function createDeployObject(next) {
let contractObject = new self.web3.eth.Contract(contract.abiDefinition);
let contractObject = self.blockchain.ContractObject({abi: contract.abiDefinition});
try {
const dataCode = contractCode.startsWith('0x') ? contractCode : "0x" + contractCode;