1
This commit is contained in:
parent
3f52ed5f58
commit
1688743a2e
@ -40,11 +40,25 @@ class BlockChain {
|
||||
this.web3.eth.handleRevert = true;
|
||||
this.web3.eth.accounts.wallet.add(this.getPrivateKey());
|
||||
for (const data of this.contractsConf) {
|
||||
try {
|
||||
this[`${data.name}Instance`] = await this.initInstance
|
||||
(this.getUserAddress(), data.address, this.netDir + data.json);
|
||||
} catch (err) {
|
||||
if (utils.isOnlineEnv()) {
|
||||
throw new Error(err);
|
||||
} else {
|
||||
if (data.name == 'AridropNft') {
|
||||
log.warning('load contract file error:' + err);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
const chainId = await this.web3.eth.getChainId();
|
||||
if (chainId != this.netId) {
|
||||
throw new Error(util.format('net id error %s %s',
|
||||
chainId,
|
||||
this.netId
|
||||
));
|
||||
log.warning(util.format('net id error %s %s',
|
||||
chainId,
|
||||
this.netId
|
||||
|
@ -23,6 +23,14 @@ function registerMetaClass(fileName, primKey, wrapClass) {
|
||||
metaClasses[wrapClass] = metaClass;
|
||||
}
|
||||
|
||||
function checkNetData(net) {
|
||||
net['Events'].forEach(
|
||||
(item) => {
|
||||
console.log(item);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function load() {
|
||||
metaClassList.forEach((metaClass) => {
|
||||
const json = utils.readJsonFromFile(metaClass['fileName']);
|
||||
@ -126,6 +134,7 @@ async function init() {
|
||||
'refresh_erc1155': net['refresh_erc1155'],
|
||||
'refresh_erc20': net['refresh_erc20'],
|
||||
};
|
||||
checkNetData(web3ConfHash[netId]);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
2
third_party/becrypto
vendored
2
third_party/becrypto
vendored
@ -1 +1 @@
|
||||
Subproject commit 727a3ffd5c809eced13837594ac9288415b0118b
|
||||
Subproject commit e294ca4ebe3c603359c8dd349590f336a94383c1
|
Loading…
x
Reference in New Issue
Block a user