Skip to content

Commit

Permalink
Merge pull request #236 from MickWang/master
Browse files Browse the repository at this point in the history
show node name for vote
  • Loading branch information
MickWang committed Jul 4, 2020
2 parents f5f3664 + 5361a28 commit 3c283ad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/renderer/components/Node/Vote/Detail.vue
Expand Up @@ -156,11 +156,11 @@ export default {
{ name: this.$t("vote.votingTopics"), path: "/vote/votes" }
];
const columns = [
// {
// dataIndex: "name",
// key: "name",
// title: this.$t("vote.name")
// },
{
dataIndex: "name",
key: "name",
title: this.$t("vote.name")
},
{
dataIndex: "address",
key: "address",
Expand Down
8 changes: 4 additions & 4 deletions src/renderer/store/modules/Vote.js
@@ -1,4 +1,4 @@
import { NODE_CURRENT_STAKES, VOTE_ROLE, DEFAULT_SCRYPT, ONT_PASS_NODE, ONT_PASS_NODE_PRD,
import { NODE_CURRENT_STAKES,OFF_CHAIN_NODES, VOTE_ROLE, DEFAULT_SCRYPT, ONT_PASS_NODE, ONT_PASS_NODE_PRD,
ONT_PASS_URL } from '../../../core/consts'
import httpService, { getRestClient } from '../../../core/utils'
import { TransactionBuilder, Crypto, utils, Parameter, ParameterType, TxSignature, WebsocketClient } from 'ontology-ts-sdk'
Expand Down Expand Up @@ -264,16 +264,16 @@ const actions = {
}
for(const admin_from_chain of all_voters) {
for(const admin_from_api of res1.result) {
const addr = Crypto.Address.fromPubKey(new Crypto.PublicKey(admin_from_api.public_key)).toBase58()
if(addr === admin_from_chain.address) {
const pk_address = Crypto.Address.fromPubKey(new Crypto.PublicKey(admin_from_api.public_key)).toBase58()
if(pk_address === admin_from_chain.address) {
admin_from_chain.name = admin_from_api.name
admin_from_chain.weight = admin_from_api.current_stake
break;
} else {
admin_from_chain.name = admin_from_chain.address.substr(0,8)
}
}
}

// const all_voters = res1.result.map(item => ({ name: item.name, address: item.address, weight: item.current_stake }))
commit('UPDATE_ALL_VOTERS', { all_voters })
for (let node of all_voters) {
Expand Down

0 comments on commit 3c283ad

Please sign in to comment.