Skip to content

Commit b9dc145

Browse files
author
atom-young
committed
fix: πŸ› handle method call error
1 parent 0311e78 commit b9dc145

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

β€Žapp/schedule/dividend.jsβ€Ž

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,17 @@ class Dividend extends Subscription {
3535
getContract(endpoint, 'AElf.ContractNames.Treasury'),
3636
getContract(endpoint, 'AElf.ContractNames.Consensus')
3737
]);
38-
const [
39-
undistributed,
40-
miner
41-
] = await Promise.all([
42-
treasury.GetUndistributedDividends.call(),
43-
consensus.GetCurrentTermMiningReward.call()
44-
]);
38+
let undistributed = {
39+
value: {
40+
ELF: 0
41+
}
42+
};
43+
const miner = await consensus.GetCurrentTermMiningReward.call();
44+
try {
45+
undistributed = treasury.GetUndistributedDividends.call();
46+
} catch (e) {
47+
console.log('call contract method failed');
48+
}
4549
if (undistributed && undistributed.value) {
4650
dividends.value = {
4751
...(undistributed.value || {}),

β€Žconfig/config.default.jsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ module.exports = appInfo => {
8585
// θŠ‚η‚Ήεœ°ε€
8686
config.endpoint = process.env.CHAIN_ENDPOINT;
8787

88-
config.sideChainAPI = process.env.SIDE_CHAIN_APIS.split(',');
88+
config.sideChainAPI = process.env.SIDE_CHAIN_APIS.split(',').filter(v => v !== '');
8989
config.tpsInterval = 60 * 1000; // ms
9090
config.tpsListRedisKey = 'tps_list_3_h';
9191

0 commit comments

Comments
Β (0)