From 4630ce63b1e5ec877e87ea1ce46e942821f69f84 Mon Sep 17 00:00:00 2001
From: donne1226 <503124742@qq.com>
Date: Tue, 15 Mar 2022 22:10:04 +0800
Subject: [PATCH] fix
---
src/libs/fetch.js | 8 ++++
src/views/Staking.vue | 106 ++++++++++++++++++++++++++----------------
2 files changed, 74 insertions(+), 40 deletions(-)
diff --git a/src/libs/fetch.js b/src/libs/fetch.js
index 450c370d..4bb1830d 100644
--- a/src/libs/fetch.js
+++ b/src/libs/fetch.js
@@ -156,6 +156,14 @@ export default class ChainFetch {
})
}
+ async getValidatorListByStatus(status) {
+ return this.get(`/cosmos/staking/v1beta1/validators?status=${status}`).then(data => {
+ const result = commonProcess(data)
+ const vals = result.validators ? result.validators : result
+ return vals.map(i => new Validator().init(i))
+ })
+ }
+
async getValidatorListByHeight(height) {
return this.get(`/validatorsets/${height}`).then(data => commonProcess(data))
}
diff --git a/src/views/Staking.vue b/src/views/Staking.vue
index 98c2cd3e..58040931 100644
--- a/src/views/Staking.vue
+++ b/src/views/Staking.vue
@@ -93,17 +93,18 @@
no-body
>
-
-
-
-
- Top 33%
-
-
-
- Top 67% of Voting Power
-
-
+
+
+
+
Validators {{ validators.length }}/{{ stakingParameters.max_validators }}
@@ -195,6 +196,18 @@
+
+
+
+
+
+ Top 33%
+
+
+
+ Top 67% of Voting Power
+
+
@@ -202,10 +215,10 @@