From 49f7564f6c228be1906af1217595dd3569d27527 Mon Sep 17 00:00:00 2001 From: liangping <18786721@qq.com> Date: Sun, 1 Sep 2024 23:55:06 +0800 Subject: [PATCH] sort validators --- src/modules/[chain]/uptime/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/[chain]/uptime/index.vue b/src/modules/[chain]/uptime/index.vue index b9663a0f..852338d6 100644 --- a/src/modules/[chain]/uptime/index.vue +++ b/src/modules/[chain]/uptime/index.vue @@ -103,7 +103,7 @@ baseStore.$subscribe((_, state) => { const chain_id = state.latest.block.header.chain_id; Promise.resolve().then(async () =>{ await stakingStore.getConsumerValidators(chain_id).then((x) => { - x.validators.forEach(v => { + x.validators.sort((a,b) => Number(b.power)-Number(a.power)).forEach(v => { const base64 = toBase64(fromHex(consensusPubkeyToHexAddress({"@type": "/cosmos.crypto.ed25519.PubKey", key: v.consumer_key.ed25519 }))); const moniker = v.provider_address; consumerValidators.value.push({ moniker, base64});