forked from cerc-io/cosmos-explorer
feat: add governance params
This commit is contained in:
parent
921536983d
commit
248f4411e3
@ -30,7 +30,7 @@ onMounted(() => {
|
||||
<CardParameter :cardItem="store.staking"/>
|
||||
|
||||
<!-- Governance Parameters -->
|
||||
|
||||
<CardParameter :cardItem="store.gov"/>
|
||||
<!-- Distribution Parameters -->
|
||||
<CardParameter :cardItem="store.distribution"/>
|
||||
<!-- Slashing Parameters -->
|
||||
|
@ -49,9 +49,6 @@ export const useParamStore = defineStore("paramstore", {
|
||||
blockchain() {
|
||||
return useBlockchain()
|
||||
},
|
||||
excludes() {
|
||||
return this.blockchain().current?.excludes
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
initial() {
|
||||
@ -60,6 +57,7 @@ export const useParamStore = defineStore("paramstore", {
|
||||
this.handleStakingParams()
|
||||
this.handleSlashingParams()
|
||||
this.handleDistributionParams()
|
||||
this.handleGovernanceParams()
|
||||
},
|
||||
async handleBaseBlockLatest() {
|
||||
try {
|
||||
@ -121,9 +119,16 @@ export const useParamStore = defineStore("paramstore", {
|
||||
value: value }))
|
||||
},
|
||||
async handleGovernanceParams() {
|
||||
if(this.excludes && this.excludes.indexOf('governance') > -1){
|
||||
const excludes = this.blockchain.current?.excludes
|
||||
if(excludes && excludes.indexOf('governance') > -1){
|
||||
return
|
||||
}
|
||||
Promise.all([this.getGovParamsVoting(),this.getGovParamsDeposit(),this.getGovParamsTally()]).then((resArr) => {
|
||||
console.log(resArr, 'resArrr')
|
||||
const govParams = {...resArr[0]?.voting_params,...resArr[1]?.deposit_params,...resArr[2]?.tally_params}
|
||||
this.gov.items = Object.entries(govParams).map(([key, value]) => ({ subtitle:key,
|
||||
value: value }))
|
||||
})
|
||||
|
||||
},
|
||||
async getBaseTendermintBlockLatest() {
|
||||
@ -164,6 +169,7 @@ export const useParamStore = defineStore("paramstore", {
|
||||
return await this.blockchain.rpc.getGovParamsTally()
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user