From 350bdb6cbd313f4be04af1b2e8ccee5f9a593e33 Mon Sep 17 00:00:00 2001 From: liangping <18786721@qq.com> Date: Sun, 25 Sep 2022 09:19:20 +0800 Subject: [PATCH] fix issue --- src/views/UptimeMyValidators.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/views/UptimeMyValidators.vue b/src/views/UptimeMyValidators.vue index b1022684..01b79abb 100644 --- a/src/views/UptimeMyValidators.vue +++ b/src/views/UptimeMyValidators.vue @@ -37,6 +37,7 @@ import { BRow, BCol, VBTooltip, BAlert, } from 'bootstrap-vue' import { consensusPubkeyToHexAddress, getCachedValidators, getLocalChains } from '@/libs/utils' +import { fromHex, toBase64 } from '@cosmjs/encoding' import UptimeMyChainBlocks from './UptimeMyChainBlocks.vue' export default { @@ -71,7 +72,7 @@ export default { if (cached) { const validators = [] 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 }) }) chainVals[x] = validators @@ -79,7 +80,7 @@ export default { this.$http.getValidatorList(configs[x]).then((vals => { const validators = [] 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 }) }) this.$set(this.chainVals, x, validators) @@ -92,6 +93,11 @@ export default { chainVals, } }, + methods: { + hex2base64(v) { + return toBase64(fromHex(v)) + }, + }, }