Update addresses for core network

This commit is contained in:
viktor 2017-12-25 22:25:17 +03:00
parent 1ec785d110
commit d7dade298c
7 changed files with 87 additions and 12 deletions

3
.gitignore vendored
View File

@ -1,2 +1,3 @@
node_modules/
.DS_Store
.DS_Store
build/

58
package-lock.json generated
View File

@ -1,5 +1,5 @@
{
"name": "voting",
"name": "poa-dapps-voting",
"version": "0.1.0",
"lockfileVersion": 1,
"requires": true,
@ -1385,6 +1385,11 @@
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.1.tgz",
"integrity": "sha512-dwVUVIXsBZXwTuwnXI9RK8sBmgq09NDHzyR9SAph9eqk76gKK2JSQmZARC2zRC81JC2QTtxD0ARU5qTS25gIGw=="
},
"base64url": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/base64url/-/base64url-2.0.0.tgz",
"integrity": "sha1-6sFuA+oUOO/5Qj1puqNiYu0fcLs="
},
"batch": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz",
@ -4797,6 +4802,57 @@
"assert-plus": "1.0.0"
}
},
"gh-pages": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/gh-pages/-/gh-pages-1.1.0.tgz",
"integrity": "sha512-ZpDkeOVmIrN5mz+sBWDz5zmTqcbNJzI/updCwEv/7rrSdpTNlj1B5GhBqG7f4Q8p5sJOdnBV0SIqxJrxtZQ9FA==",
"requires": {
"async": "2.6.0",
"base64url": "2.0.0",
"commander": "2.11.0",
"fs-extra": "4.0.3",
"globby": "6.1.0",
"graceful-fs": "4.1.11",
"rimraf": "2.6.2"
},
"dependencies": {
"commander": {
"version": "2.11.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz",
"integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ=="
},
"fs-extra": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz",
"integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==",
"requires": {
"graceful-fs": "4.1.11",
"jsonfile": "4.0.0",
"universalify": "0.1.1"
}
},
"globby": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz",
"integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=",
"requires": {
"array-union": "1.0.2",
"glob": "7.1.2",
"object-assign": "4.1.1",
"pify": "2.3.0",
"pinkie-promise": "2.0.1"
}
},
"jsonfile": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
"integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=",
"requires": {
"graceful-fs": "4.1.11"
}
}
}
},
"glob": {
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",

View File

@ -1,5 +1,5 @@
{
"name": "voting",
"name": "poa-dapps-voting",
"version": "0.1.0",
"private": true,
"homepage": "https://poanetwork.github.io/poa-dapps-voting",
@ -30,6 +30,7 @@
"extract-text-webpack-plugin": "3.0.2",
"file-loader": "1.1.5",
"fs-extra": "3.0.1",
"gh-pages": "^1.1.0",
"html-webpack-plugin": "2.29.0",
"jest": "20.0.4",
"mobx": "^3.4.1",

View File

@ -7,11 +7,11 @@ import "babel-polyfill";
export class Ballots extends React.Component {
render () {
const { commonStore, ballotsStore } = this.props;
if (ballotsStore.ballotCards.length > 0) {
/*if (ballotsStore.ballotCards.length > 0) {
commonStore.hideLoading();
} else {
commonStore.showLoading();
}
}*/
return (
<section className="container ballots">
<h1 className="title">Ballots</h1>

View File

@ -1,9 +1,9 @@
module.exports = {
KEYS_MANAGER_ADDRESS: '0x0e4a78ba651fcf2058e1326e16fc9160553ca467',
VOTING_TO_CHANGE_KEYS_ADDRESS: '0x534165101c5eec16c4a18102b98b8a903644e513',
VOTING_TO_CHANGE_MIN_THRESHOLD: '0xf7ee04d7e85ecf98ad62f96b0a40ab82de1eb0e3',
VOTING_TO_CHANGE_PROXY: '0x13d3c35d9947d77c677a648b9916998c4393622f',
METADATA_ADDRESS: '0x1ada723e24f414a72bac6a127f4b2a8d91dfec38',
POA_ADDRESS: '0xf472e0e43570b9afaab67089615080cf7c20018d',
BALLOTS_STORAGE_ADDRESS: '0x886cc61ef0ec40300378104eb547c2e86117b819'
KEYS_MANAGER_ADDRESS: '0xfc90125492e58dbfe80c0bfb6a2a759c4f703ca8',
VOTING_TO_CHANGE_KEYS_ADDRESS: '0x49df4ec19243263e5db22da5865b4f482b8323a0',
VOTING_TO_CHANGE_MIN_THRESHOLD: '0x8829ebe113535826e8af17ed51f83755f675789a',
VOTING_TO_CHANGE_PROXY: '0x6b728399b41a38d4109f7af2213d4cc31ca87812',
METADATA_ADDRESS: '0xcBB2912666c7e8023B7ec78B6842702eB26336aC',
POA_ADDRESS: '0x8bf38d4764929064f2d4d3a56520a76ab3df415b',
BALLOTS_STORAGE_ADDRESS: '0x0d7590c7aedf1e7e85fc9a1ee88f6f17d3ba762f'
}

View File

@ -32,6 +32,7 @@ class AppMainRouter extends Component {
constructor(props) {
super(props);
commonStore.showLoading();
getWeb3().then(async (web3Config) => {
contractsStore.setWeb3Instance(web3Config);
@ -47,11 +48,13 @@ class AppMainRouter extends Component {
contractsStore.setValidatorMetadata(web3Config);
contractsStore.setVotingKey(web3Config);
contractsStore.getAllKeysBallots();
contractsStore.getAllMinThresholdBallots();
contractsStore.getAllProxyBallots();
await contractsStore.setMiningKey(web3Config);
console.log("votingKey", contractsStore.votingKey)
console.log("miningKey", contractsStore.miningKey)
}).catch((error) => {
commonStore.hideLoading();
console.error(error.message);
swal({
icon: 'error',

View File

@ -9,6 +9,7 @@ import VotingToChangeProxy from '../contracts/VotingToChangeProxy.contract'
import ValidatorMetadata from '../contracts/ValidatorMetadata.contract'
import ballotStore from './BallotStore'
import ballotsStore from './BallotsStore'
import commonStore from './CommonStore'
import getWeb3 from '../getWeb3';
import { BallotKeysCard } from "../components/BallotKeysCard";
import { BallotMinThresholdCard } from "../components/BallotMinThresholdCard";
@ -127,6 +128,7 @@ class ContractsStore {
}
catch(e) {
console.log(e)
this.miningKey = "0x0000000000000000000000000000000000000000";
}
}
@ -138,6 +140,10 @@ class ContractsStore {
for (let i = 0; i < allKeysBallotsIDs.length; i++) {
ballotsStore.ballotCards.push(<BallotKeysCard id={this.activeKeysBallotsIDs[i]} type={ballotStore.BallotType.keys} key={ballotsStore.ballotCards.length}/>);
}
if (allKeysBallotsIDs.length == 0) {
commonStore.hideLoading();
}
}
@action("Get all min threshold ballots")
@ -148,6 +154,10 @@ class ContractsStore {
for (let i = 0; i < allMinThresholdBallotsIDs.length; i++) {
ballotsStore.ballotCards.push(<BallotMinThresholdCard id={this.activeMinThresholdBallotsIDs[i]} type={ballotStore.BallotType.keys} key={ballotsStore.ballotCards.length}/>);
}
if (allMinThresholdBallotsIDs.length == 0) {
commonStore.hideLoading();
}
}
@action("Get all proxy ballots")
@ -158,6 +168,10 @@ class ContractsStore {
for (let i = 0; i < allProxyBallotsIDs.length; i++) {
ballotsStore.ballotCards.push(<BallotProxyCard id={this.activeProxyBallotsIDs[i]} type={ballotStore.BallotType.keys} key={ballotsStore.ballotCards.length}/>);
}
if (allProxyBallotsIDs.length == 0) {
commonStore.hideLoading();
}
}
}