forked from cerc-io/cosmos-explorer
load origin value for param change proposal
This commit is contained in:
parent
7e03e3b32d
commit
21ff37aac1
@ -10,6 +10,7 @@ export const DEFAULT: RequestRegistry = {
|
||||
url: '/cosmos/auth/v1beta1/accounts/{address}',
|
||||
adapter,
|
||||
},
|
||||
params: { url: '/cosmos/params/v1beta1/params?subspace={subspace}&key={key}', adapter },
|
||||
bank_params: { url: '/cosmos/bank/v1beta1/params', adapter },
|
||||
bank_balances_address: {
|
||||
url: '/cosmos/bank/v1beta1/balances/{address}',
|
||||
|
@ -133,6 +133,10 @@ export class CosmosRestClient extends BaseRestClient<RequestRegistry> {
|
||||
return this.request(this.registry.slashing_signing_info, {}, query);
|
||||
}
|
||||
// Gov
|
||||
async getParams(subspace: string, key: string) {
|
||||
console.log(this.registry.params, subspace, key)
|
||||
return this.request(this.registry.params, {subspace, key});
|
||||
}
|
||||
async getGovParamsVoting() {
|
||||
return this.request(this.registry.gov_params_voting, {});
|
||||
}
|
||||
|
@ -124,6 +124,8 @@ export interface RequestRegistry extends AbstractRegistry {
|
||||
base_tendermint_validatorsets_latest: Request<PaginatedTendermintValidator>;
|
||||
base_tendermint_validatorsets_height: Request<PaginatedTendermintValidator>;
|
||||
|
||||
params: Request<{param: any}>;
|
||||
|
||||
tx_txs: Request<PaginatedTxs>;
|
||||
tx_txs_block: Request<Tx>;
|
||||
tx_hash: Request<{ tx: Tx; tx_response: TxResponse }>;
|
||||
|
@ -4,6 +4,7 @@ import MdEditor from 'md-editor-v3';
|
||||
import ObjectElement from '@/components/dynamic/ObjectElement.vue';
|
||||
import {
|
||||
useBaseStore,
|
||||
useBlockchain,
|
||||
useFormatter,
|
||||
useGovStore,
|
||||
useStakingStore,
|
||||
@ -28,6 +29,7 @@ const format = useFormatter();
|
||||
const store = useGovStore();
|
||||
const dialog = useTxDialog();
|
||||
const stakingStore = useStakingStore();
|
||||
const chainStore = useBlockchain();
|
||||
|
||||
store.fetchProposal(props.proposal_id).then((res) => {
|
||||
const proposalDetail = reactive(res.proposal);
|
||||
@ -38,6 +40,20 @@ store.fetchProposal(props.proposal_id).then((res) => {
|
||||
});
|
||||
}
|
||||
proposal.value = proposalDetail;
|
||||
// load origin params if the proposal is param change
|
||||
if(proposalDetail.content?.changes) {
|
||||
proposalDetail.content?.changes.forEach((item) => {
|
||||
chainStore.rpc.getParams(item.subspace, item.key).then((res) => {
|
||||
if(proposal.value.content && res.param) {
|
||||
if(proposal.value.content.origin){
|
||||
proposal.value.content.origin.push(res.param);
|
||||
} else {
|
||||
proposal.value.content.origin = [res.param];
|
||||
};
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
const color = computed(() => {
|
||||
|
@ -28,6 +28,8 @@ export interface GovProposal {
|
||||
'@type': string;
|
||||
title?: string;
|
||||
description?: string;
|
||||
origin?: any[]
|
||||
changes?: any[];
|
||||
plan?: {
|
||||
height?: string | number;
|
||||
time?: string | number;
|
||||
|
Loading…
Reference in New Issue
Block a user