support UpdateParamsMsg

This commit is contained in:
BitcoinVM 2024-02-23 20:21:12 +08:00
parent 23d43543cb
commit 47607e7416
2 changed files with 28 additions and 0 deletions

View File

@ -54,8 +54,35 @@ store.fetchProposal(props.proposal_id).then((res) => {
}) })
}) })
} }
const msgType = proposalDetail.content['@type'] || '';
if(msgType.endsWith('MsgUpdateParams')) {
if(msgType.indexOf('staking') > -1) {
chainStore.rpc.getStakingParams().then((res) => {
addCurrentParams(res);
});
} else if(msgType.indexOf('gov') > -1) {
chainStore.rpc.getGovParamsVoting().then((res) => {
addCurrentParams(res);
});
} else if(msgType.indexOf('distribution') > -1) {
chainStore.rpc.getDistributionParams().then((res) => {
addCurrentParams(res);
});
} else if(msgType.indexOf('slashing') > -1) {
chainStore.rpc.getSlashingParams().then((res) => {
addCurrentParams(res);
});
}
}
}); });
function addCurrentParams(res: any) {
if(proposal.value.content && res.params) {
proposal.value.content.params = [proposal.value.content?.params];
proposal.value.content.current = [res.params];
}
}
const color = computed(() => { const color = computed(() => {
if (proposal.value.status === 'PROPOSAL_STATUS_PASSED') { if (proposal.value.status === 'PROPOSAL_STATUS_PASSED') {
return 'success'; return 'success';

View File

@ -31,6 +31,7 @@ export interface GovProposal {
description?: string; description?: string;
current?: any[]; current?: any[];
changes?: any[]; changes?: any[];
params?: any[];
plan?: { plan?: {
height?: string | number; height?: string | number;
time?: string | number; time?: string | number;