fix issue

This commit is contained in:
liangping 2022-09-25 09:19:20 +08:00
parent 02e307c6d0
commit 350bdb6cbd

View File

@ -37,6 +37,7 @@ import {
BRow, BCol, VBTooltip, BAlert, BRow, BCol, VBTooltip, BAlert,
} from 'bootstrap-vue' } from 'bootstrap-vue'
import { consensusPubkeyToHexAddress, getCachedValidators, getLocalChains } from '@/libs/utils' import { consensusPubkeyToHexAddress, getCachedValidators, getLocalChains } from '@/libs/utils'
import { fromHex, toBase64 } from '@cosmjs/encoding'
import UptimeMyChainBlocks from './UptimeMyChainBlocks.vue' import UptimeMyChainBlocks from './UptimeMyChainBlocks.vue'
export default { export default {
@ -71,7 +72,7 @@ export default {
if (cached) { if (cached) {
const validators = [] const validators = []
pinned[x].forEach(address => { pinned[x].forEach(address => {
const val = cached.find(v => address === consensusPubkeyToHexAddress(v.consensus_pubkey)) const val = cached.find(v => address === this.hex2base64(consensusPubkeyToHexAddress(v.consensus_pubkey)))
if (val) validators.push({ address, validator: val.description }) if (val) validators.push({ address, validator: val.description })
}) })
chainVals[x] = validators chainVals[x] = validators
@ -79,7 +80,7 @@ export default {
this.$http.getValidatorList(configs[x]).then((vals => { this.$http.getValidatorList(configs[x]).then((vals => {
const validators = [] const validators = []
pinned[x].forEach(address => { pinned[x].forEach(address => {
const val = vals.find(v => address === consensusPubkeyToHexAddress(v.consensus_pubkey)) const val = vals.find(v => address === this.hex2base64(consensusPubkeyToHexAddress(v.consensus_pubkey)))
if (val) validators.push({ address, validator: val.description }) if (val) validators.push({ address, validator: val.description })
}) })
this.$set(this.chainVals, x, validators) this.$set(this.chainVals, x, validators)
@ -92,6 +93,11 @@ export default {
chainVals, chainVals,
} }
}, },
methods: {
hex2base64(v) {
return toBase64(fromHex(v))
},
},
} }
</script> </script>