From 5fc827fcf76742a471e744fa4a36baca022357bb Mon Sep 17 00:00:00 2001 From: liangping <18786721@qq.com> Date: Mon, 27 Jan 2025 15:46:28 +0800 Subject: [PATCH] fixed address decode issue --- src/modules/[chain]/gov/[proposal_id].vue | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/modules/[chain]/gov/[proposal_id].vue b/src/modules/[chain]/gov/[proposal_id].vue index 943f9ebb..cfc9aff8 100644 --- a/src/modules/[chain]/gov/[proposal_id].vue +++ b/src/modules/[chain]/gov/[proposal_id].vue @@ -197,12 +197,16 @@ const processList = computed(() => { }); function showValidatorName(voter: string) { - const { data } = fromBech32(voter); - const hex = toHex(data); - const v = stakingStore.validators.find( - (x) => toHex(fromBech32(x.operator_address).data) === hex - ); - return v ? v.description.moniker : voter; + try { + const { data } = fromBech32(voter); + const hex = toHex(data); + const v = stakingStore.validators.find( + (x) => toHex(fromBech32(x.operator_address).data) === hex + ); + return v ? v.description.moniker : voter; + } catch(e){ + return voter; + } } function pageload(p: number) { @@ -396,7 +400,7 @@ function metaItem(metadata: string|undefined): { title: string; summary: string