diff --git a/src/components/dynamic/index.ts b/src/components/dynamic/index.ts index e3687673..2a3e6854 100644 --- a/src/components/dynamic/index.ts +++ b/src/components/dynamic/index.ts @@ -51,10 +51,6 @@ const typeMap = Object.fromEntries( Object.entries(MsgType).map(([k, v]) => ['/' + v, k]) ); -Object.assign(typeMap, { - '/cosmos.params.v1beta1.ParameterChangeProposal': 'ParameterChangeProposal', -}); - const findType = (obj: any, type: string): any => { if (typeof obj !== 'object') return; const msg = obj[type]; @@ -66,9 +62,10 @@ const findType = (obj: any, type: string): any => { }; export const decodeProto = (msg: { typeUrl: string; value: Uint8Array }) => { - const type = typeMap[msg.typeUrl]; + const type = typeMap[msg.typeUrl] ?? msg.typeUrl.split('.').pop(); if (type) { const obj = findType(injProto, type); + if (obj) { const res = obj.decode(msg.value); if (res.msgs) { diff --git a/src/modules/[chain]/gov/[proposal_id].vue b/src/modules/[chain]/gov/[proposal_id].vue index 30893093..fa8ff548 100644 --- a/src/modules/[chain]/gov/[proposal_id].vue +++ b/src/modules/[chain]/gov/[proposal_id].vue @@ -53,6 +53,8 @@ store.fetchProposal(props.proposal_id).then((res) => { proposalDetail.content! ) as ParameterChangeProposal; Object.assign(proposalDetail.content!, changeProposal); + // @ts-ignore + delete proposalDetail.content.value; // when status under the voting, final_tally_result are no data, should request fetchTally if (proposalDetail.status === ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD) { // 'PROPOSAL_STATUS_VOTING_PERIOD') {