Fix issues

This commit is contained in:
liangping 2022-08-30 08:33:15 +08:00
parent 081421d76e
commit 8cf5942065
4 changed files with 16 additions and 24 deletions

View File

@ -21,7 +21,6 @@ const handler = class DefaultHandler {
}
processProposalTally(tally) {
console.log(tally)
const result = this.commonProcess(tally)
return result
}

View File

@ -102,26 +102,26 @@ export default class ChainFetch {
}
async getValidatorDistribution(address) {
return this.get(`/distribution/validators/${address}`).then(data => {
const value = commonProcess(data)
const ret = ValidatorDistribution.create({
operator_address: address,
self_bond_rewards: value.self_bond_rewards,
val_commission: value.val_commission.commission,
})
return ret
})
// return Promise.all([
// this.get(`/cosmos/distribution/v1beta1/validators/${address}/commission`),
// this.get(`/cosmos/distribution/v1beta1/validators/${address}/outstanding_rewards`),
// ]).then(data => {
// return this.get(`/distribution/validators/${address}`).then(data => {
// const value = commonProcess(data)
// const ret = ValidatorDistribution.create({
// operator_address: address,
// self_bond_rewards: data[1].rewards.rewards,
// val_commission: data[0].commission.commission,
// self_bond_rewards: value.self_bond_rewards,
// val_commission: value.val_commission.commission,
// })
// return ret
// })
return Promise.all([
this.get(`/cosmos/distribution/v1beta1/validators/${address}/commission`),
this.get(`/cosmos/distribution/v1beta1/validators/${address}/outstanding_rewards`),
]).then(data => {
const ret = ValidatorDistribution.create({
operator_address: address,
self_bond_rewards: data[1].rewards.rewards,
val_commission: data[0].commission.commission,
})
return ret
})
}
async getStakingDelegatorDelegation(delegatorAddr, validatorAddr) {

View File

@ -123,13 +123,7 @@
<span class="font-weight-bold">Status</span>
</th>
<td class="pb-50 text-capitalize">
<b-badge
v-if="validator.status===3"
variant="light-success"
>
Active
</b-badge>
<span v-else>{{ validator.status }}</span>
<span>{{ String(validator.status).replace('BOND_STATUS_', '') }}</span>
</td>
</tr>
<tr>

View File

@ -200,7 +200,6 @@
</div>
</div>
<b-button
v-if="balances[acc.addr]"
block
size="sm"
variant="outline-primary"