1
This commit is contained in:
parent
e6572a59f0
commit
a4927c82b6
@ -33,6 +33,7 @@ class BlockChain {
|
||||
|
||||
async init() {
|
||||
this.web3Conf = metaFactory.getWeb3Conf(this.netId);
|
||||
console.log(this.web3Conf);
|
||||
this.contractsConf = metaFactory.getContractsConf(this.netId);
|
||||
this.netDir = metaFactory.getNetDir(this.netId);
|
||||
|
||||
|
@ -157,28 +157,29 @@ function traverseMetaList(name, cb) {
|
||||
}
|
||||
}
|
||||
|
||||
function getWeb3Conf(netId) {
|
||||
function getConf(netId) {
|
||||
const keys = Object.keys(web3ConfHash);
|
||||
for (let i = 0; i < keys.length; ++i) {
|
||||
if (keys[i] == netId) {
|
||||
return web3ConfHash[keys[i]]['Web3'];
|
||||
const conf = web3ConfHash[keys[i]];
|
||||
if (conf['net_id'] == netId) {
|
||||
return conf;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function getWeb3Conf(netId) {
|
||||
const conf = getConf(netId);
|
||||
return conf ? conf['Web3'] : null;
|
||||
}
|
||||
|
||||
function getWeb3BcSpiderConf() {
|
||||
return web3BcSpiderConf;
|
||||
}
|
||||
|
||||
function getContractsConf(netId) {
|
||||
const keys = Object.keys(web3ConfHash);
|
||||
for (let i = 0; i < keys.length; ++i) {
|
||||
if (keys[i] == netId) {
|
||||
return web3ConfHash[keys[i]]['Contract'];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
const conf = getConf(netId);
|
||||
return conf ? conf['Contract'] : null;
|
||||
}
|
||||
|
||||
function getNetList() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user