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"/>
|
<CardParameter :cardItem="store.staking"/>
|
||||||
|
|
||||||
<!-- Governance Parameters -->
|
<!-- Governance Parameters -->
|
||||||
|
<CardParameter :cardItem="store.gov"/>
|
||||||
<!-- Distribution Parameters -->
|
<!-- Distribution Parameters -->
|
||||||
<CardParameter :cardItem="store.distribution"/>
|
<CardParameter :cardItem="store.distribution"/>
|
||||||
<!-- Slashing Parameters -->
|
<!-- Slashing Parameters -->
|
||||||
|
@ -49,9 +49,6 @@ export const useParamStore = defineStore("paramstore", {
|
|||||||
blockchain() {
|
blockchain() {
|
||||||
return useBlockchain()
|
return useBlockchain()
|
||||||
},
|
},
|
||||||
excludes() {
|
|
||||||
return this.blockchain().current?.excludes
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
initial() {
|
initial() {
|
||||||
@ -60,6 +57,7 @@ export const useParamStore = defineStore("paramstore", {
|
|||||||
this.handleStakingParams()
|
this.handleStakingParams()
|
||||||
this.handleSlashingParams()
|
this.handleSlashingParams()
|
||||||
this.handleDistributionParams()
|
this.handleDistributionParams()
|
||||||
|
this.handleGovernanceParams()
|
||||||
},
|
},
|
||||||
async handleBaseBlockLatest() {
|
async handleBaseBlockLatest() {
|
||||||
try {
|
try {
|
||||||
@ -121,9 +119,16 @@ export const useParamStore = defineStore("paramstore", {
|
|||||||
value: value }))
|
value: value }))
|
||||||
},
|
},
|
||||||
async handleGovernanceParams() {
|
async handleGovernanceParams() {
|
||||||
if(this.excludes && this.excludes.indexOf('governance') > -1){
|
const excludes = this.blockchain.current?.excludes
|
||||||
|
if(excludes && excludes.indexOf('governance') > -1){
|
||||||
return
|
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() {
|
async getBaseTendermintBlockLatest() {
|
||||||
@ -164,6 +169,7 @@ export const useParamStore = defineStore("paramstore", {
|
|||||||
return await this.blockchain.rpc.getGovParamsTally()
|
return await this.blockchain.rpc.getGovParamsTally()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user