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);
|
this.web3.eth.getCode(address, cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getBlock(blockNumber, cb) {
|
||||||
|
this.web3.eth.getBlock(blockNumber, cb);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Blockchain;
|
module.exports = Blockchain;
|
||||||
|
|
|
@ -26,7 +26,7 @@ class Deploy {
|
||||||
|
|
||||||
initTracker(cb) {
|
initTracker(cb) {
|
||||||
this.deployTracker = new DeployTracker({
|
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);
|
}, cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,14 +7,14 @@ class DeployTracker {
|
||||||
this.logger = options.logger;
|
this.logger = options.logger;
|
||||||
this.env = options.env;
|
this.env = options.env;
|
||||||
this.chainConfig = options.chainConfig;
|
this.chainConfig = options.chainConfig;
|
||||||
this.web3 = options.web3;
|
this.blockchain = options.blockchain;
|
||||||
|
|
||||||
if (this.chainConfig === false) {
|
if (this.chainConfig === false) {
|
||||||
this.currentChain = {contracts: []};
|
this.currentChain = {contracts: []};
|
||||||
return cb();
|
return cb();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.web3.eth.getBlock(0, function(err, block) {
|
this.blockchain.getBlock(0, function(err, block) {
|
||||||
let chainId = block.hash;
|
let chainId = block.hash;
|
||||||
|
|
||||||
if (self.chainConfig[chainId] === undefined) {
|
if (self.chainConfig[chainId] === undefined) {
|
||||||
|
|
Loading…
Reference in New Issue