From ecfe1f3ec4c9eede412e8176266b60a687637ec5 Mon Sep 17 00:00:00 2001 From: liangping <18786721@qq.com> Date: Sun, 28 Aug 2022 17:35:01 +0800 Subject: [PATCH] fix hash issue and 24H changes --- src/views/Staking.vue | 4 ++-- src/views/StateSync.vue | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/views/Staking.vue b/src/views/Staking.vue index 84b38bf4..e1e9f8cd 100644 --- a/src/views/Staking.vue +++ b/src/views/Staking.vue @@ -315,8 +315,8 @@ export default { return tab.map(x => { const xh = x if (Object.keys(this.latestPower).length > 0 && Object.keys(this.previousPower).length > 0) { - const latest = this.latestPower[x.consensus_pubkey.value] || 0 - const previous = this.previousPower[x.consensus_pubkey.value] || 0 + const latest = this.latestPower[x.consensus_pubkey.key] || 0 + const previous = this.previousPower[x.consensus_pubkey.key] || 0 xh.changes = latest - previous } return xh diff --git a/src/views/StateSync.vue b/src/views/StateSync.vue index 2cb10095..4501f04c 100644 --- a/src/views/StateSync.vue +++ b/src/views/StateSync.vue @@ -59,6 +59,7 @@ import { BCard, BCardTitle, BFormTextarea, } from 'bootstrap-vue' +import { fromBase64, toHex } from '@cosmjs/encoding' export default { components: { @@ -113,7 +114,7 @@ snapshot-keep-recent = 2`, const { height } = l.block.header if (height > interval * 3) { this.$http.getBlockByHeight(Math.trunc((height - 3 * interval) / interval) * interval).then(x => { - this.hash = x.block_id.hash + this.hash = toHex(fromBase64(x.block_id.hash)) this.height = x.block.header.height this.state = `[statesync] enable = true