Skip to content

Commit 6d46715

Browse files
committed
2 parents 8c24690 + ff29a3e commit 6d46715

File tree

38 files changed

+429
-826
lines changed

38 files changed

+429
-826
lines changed

config/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const ADDRESS_INFO = {
1818
// ChainId: tDVY, Symbol: EDC (AElf developer support chain C)
1919
// ChainId: tDVZ, Symbol: EDD (AElf developer support chain D)
2020
const CHAINS_LINK = {
21-
AELF: 'http://explorer-test.aelf.io',
21+
AELF: 'https://explorer-test.aelf.io',
2222
tDVV: 'https://explorer-test-side01.aelf.io',
2323
tDVW: 'https://explorer-test-side02.aelf.io',
2424
tDVX: 'https://explorer-test-side03.aelf.io',

config/config.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,28 @@
1111
"tokenConverter": "AElf.ContractNames.TokenConverter",
1212
"feeReceiverContract": "AElf.ContractNames.Token"
1313
},
14+
"schemeIds": [
15+
{
16+
"type": "CitizenWelfare",
17+
"schemeId": "f2e70e09c94616f91f6b084d9a2c025d2cb27aea1860cf3f467b496c647b163f"
18+
},
19+
{
20+
"type": "BackupSubsidy",
21+
"schemeId": "208d098067699730d220f1997d48c8b8d8881bb8507abfad1b07d9af8ba94bb0"
22+
},
23+
{
24+
"type": "VotesWeight",
25+
"schemeId": "9a7f406cf485dd91439c848dea23b5c03029aee63cd8077710ca05865f73ed99"
26+
},
27+
{
28+
"type": "MinerBasic",
29+
"schemeId": "58c0ee2b5eab330cafa5df680399a6374c7e86bbbcabeda0b70eb0a98a4f788a"
30+
},
31+
{
32+
"type": "ReElection",
33+
"schemeId": "291c0cc8fd51e02c02cb95c235f8d41a14793f8e8bf4810e3e44aaf89e7c3389"
34+
}
35+
],
1436
"voteContractAddr": "xw6U3FRE5H8rU3z8vAgF9ivnWSkxULK5cibdZzMC9UWf7rPJf",
1537
"electionContractAddr": "2J9wWhuyz7Drkmtu9DTegM9rLmamjekmRkCAWz5YYPjm7akfbH",
1638
"profitContractAddr": "jDpXvpfC2qpriNFgZh68nRpJ5juN51ehcJNJwAcr5Z1UhfFTJ",

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"commit": "git-cz"
1414
},
1515
"dependencies": {
16-
"aelf-sdk": "3.2.23",
16+
"aelf-sdk": "3.2.24",
1717
"antd": "^3.24.2",
1818
"apisauce": "^0.16.0",
1919
"axios": "^0.18.0",
@@ -31,6 +31,7 @@
3131
"query-string": "^5.0.0",
3232
"react": "^16.5.1",
3333
"react-dom": "^16.5.1",
34+
"react-if": "^3.4.3",
3435
"react-redux": "^7.1.1",
3536
"react-router": "^4.3.1",
3637
"react-router-dom": "^4.3.1",

scripts/queryConfigs.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ const result = {
1616

1717
async function getConfig() {
1818
const {
19-
CONTRACTS
19+
CONTRACTS,
20+
schemeIds
2021
} = config;
2122
const {
2223
ChainId,
@@ -35,6 +36,26 @@ async function getConfig() {
3536
result.SYMBOL = symbol;
3637
}
3738
}
39+
if (result.electionContractAddr) {
40+
const profit = await aelf.chain.contractAt(result.profitContractAddr, wallet);
41+
const electionSchemeIds = (await profit.GetManagingSchemeIds.call({
42+
manager: result.electionContractAddr
43+
})).schemeIds;
44+
const treasurySchemaIds = (await profit.GetManagingSchemeIds.call({
45+
manager: result.dividends
46+
})).schemeIds;
47+
const schemes = [
48+
treasurySchemaIds[1],
49+
electionSchemeIds[0],
50+
treasurySchemaIds[3],
51+
treasurySchemaIds[2],
52+
treasurySchemaIds[4]
53+
].map((v, i) => ({
54+
type: schemeIds[i].type,
55+
schemeId: v
56+
}));
57+
result.schemeIds = schemes;
58+
}
3859
console.log(result);
3960
fs.writeFileSync(path.resolve('./config/config.json'), `${JSON.stringify(result, null, 2)}\n`);
4061
}

src/assets/less/common.less

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
text-align: left;
3636
}
3737

38+
.text-right {
39+
text-align: right;
40+
}
41+
3842
.bold-text {
3943
font-weight: bold;
4044
}

src/components/StatisticalData/index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,25 +65,24 @@ export default class StatisticalData extends PureComponent {
6565
}
6666

6767
renderList(arr) {
68-
return arr.map(item => {
68+
return arr.map((item, index) => {
6969
let number = item.num;
7070
if (item.id === 3) {
7171
number = (number / 100000000).toFixed(2);
7272
}
7373

7474
return item.isCountdown ? (
7575
<Countdown
76-
key={Math.random()}
76+
key={index}
7777
title={item.title}
7878
value={item.num || 0}
7979
format="D day HH : mm : ss "
8080
onFinish={() => {
81-
console.log('finished');
8281
this.handleFinish(item.id);
8382
}}
8483
/>
8584
) : (
86-
<Statistic key={Math.random()} title={item.title} value={number} />
85+
<Statistic key={index} title={item.title} value={isNaN(parseInt(number, 10)) ? 0 : number} />
8786
);
8887
});
8988
}

src/constants.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ import { Link } from 'react-router-dom';
88
import { Icon } from 'antd';
99
import dayjs from 'dayjs';
1010
import relativeTime from 'dayjs/plugin/relativeTime';
11-
import { isArray } from 'zrender/lib/core/util';
1211

13-
import Button from './components/Button/Button';
1412
import { DEFAUTRPCSERVER, SYMBOL, CHAIN_ID, ADDRESS_INFO } from '../config/config';
1513
import { thousandsCommaWithDecimal } from '@utils/formater';
1614

0 commit comments

Comments
 (0)