move Contract object to blockchain module
This commit is contained in:
parent
84dcfca254
commit
9b1a78cdaa
|
@ -90,6 +90,10 @@ class Blockchain {
|
||||||
this.web3.eth.getBlock(blockNumber, cb);
|
this.web3.eth.getBlock(blockNumber, cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ContractObject(params) {
|
||||||
|
return new this.web3.eth.Contract(params.abi);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Blockchain;
|
module.exports = Blockchain;
|
||||||
|
|
|
@ -308,7 +308,7 @@ class Deploy {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
function createDeployObject(next) {
|
function createDeployObject(next) {
|
||||||
let contractObject = new self.web3.eth.Contract(contract.abiDefinition);
|
let contractObject = self.blockchain.ContractObject({abi: contract.abiDefinition});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const dataCode = contractCode.startsWith('0x') ? contractCode : "0x" + contractCode;
|
const dataCode = contractCode.startsWith('0x') ? contractCode : "0x" + contractCode;
|
||||||
|
|
Loading…
Reference in New Issue