move getBlock to blockchain module
This commit is contained in:
parent
1547a115a4
commit
84dcfca254
|
@ -86,6 +86,10 @@ class Blockchain {
|
|||
this.web3.eth.getCode(address, cb);
|
||||
}
|
||||
|
||||
getBlock(blockNumber, cb) {
|
||||
this.web3.eth.getBlock(blockNumber, cb);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = Blockchain;
|
||||
|
|
|
@ -26,7 +26,7 @@ class Deploy {
|
|||
|
||||
initTracker(cb) {
|
||||
this.deployTracker = new DeployTracker({
|
||||
logger: this.logger, chainConfig: this.chainConfig, web3: this.web3, env: this.env
|
||||
logger: this.logger, chainConfig: this.chainConfig, blockchain: this.blockchain, env: this.env
|
||||
}, cb);
|
||||
}
|
||||
|
||||
|
|
|
@ -7,14 +7,14 @@ class DeployTracker {
|
|||
this.logger = options.logger;
|
||||
this.env = options.env;
|
||||
this.chainConfig = options.chainConfig;
|
||||
this.web3 = options.web3;
|
||||
this.blockchain = options.blockchain;
|
||||
|
||||
if (this.chainConfig === false) {
|
||||
this.currentChain = {contracts: []};
|
||||
return cb();
|
||||
}
|
||||
|
||||
this.web3.eth.getBlock(0, function(err, block) {
|
||||
this.blockchain.getBlock(0, function(err, block) {
|
||||
let chainId = block.hash;
|
||||
|
||||
if (self.chainConfig[chainId] === undefined) {
|
||||
|
|
Loading…
Reference in New Issue