fix all build checks

This commit is contained in:
liangping
2023-06-08 10:02:47 +08:00
parent e2782c1e00
commit a25dde89f5
18 changed files with 123 additions and 80 deletions
+12 -5
View File
@@ -7,11 +7,12 @@ import {
useDashboard,
useStakingStore,
} from '@/stores';
import { consensusPubkeyToHexAddress } from '@/libs';
const format = useFormatter();
const chainStore = useBlockchain();
const dashboard = useDashboard();
const stakingStore = useStakingStore();
import { consensusPubkeyToHexAddress } from '@/libs';
const rpcList = ref(
chainStore.current?.endpoints?.rpc || [{ address: '', provider: '' }]
);
@@ -42,21 +43,24 @@ onUnmounted(() => {
});
const newTime = computed(() => {
return format.toDay(updatetime.value || '', 'time');
return format.toDay(updatetime.value?.toDateString(), 'time');
});
const vals = computed(() => {
return validators.value.map((x) => {
const x2 = x;
// @ts-ignore
x2.hex = consensusPubkeyToHexAddress(x.consensus_pubkey);
return x2;
});
});
function showName(i, text) {
function showName(i:number, text: string) {
if (text === 'nil-Vote') {
// @ts-ignore
if (positions.value?.[i]?.address) {
const val = vals.value.find(
// @ts-ignore
(x) => x.hex === positions.value?.[i]?.address
);
return val?.description?.moniker || i;
@@ -65,10 +69,11 @@ function showName(i, text) {
}
const txt = text.substring(text.indexOf(':') + 1, text.indexOf(' '));
const sig = text.split(' ');
// @ts-ignore
const val = validators.value.find((x) => x?.hex?.startsWith(txt));
return `${val?.description?.moniker || txt} - ${sig[2]}`;
}
function color(i, txt) {
function color(i: number, txt: string) {
if (i === roundState.value?.proposer?.index) {
return txt === 'nil-Vote' ? 'warning' : 'primary';
}
@@ -99,7 +104,9 @@ async function fetchPosition() {
const data = await response.json();
positions.value = data.result.round_state.validators.validators;
} catch (error) {
// @ts-ignore
httpstatus.value = error?.status || 500;
// @ts-ignore
httpStatusText.value = error?.message || 'Error';
}
}
@@ -125,7 +132,7 @@ async function update() {
step.value = raw[2];
// find the highest onboard rate
roundState.value?.height_vote_set?.forEach((element) => {
roundState.value?.height_vote_set?.forEach((element: any) => {
const rates = Number(
element.prevotes_bit_array.substring(
element.prevotes_bit_array.length - 4
+5 -2
View File
@@ -9,7 +9,7 @@ import {
import { useDistributionStore } from '@/stores/useDistributionStore';
import { useMintStore } from '@/stores/useMintStore';
import { useStakingStore } from '@/stores/useStakingStore';
import type { Tally } from '@/types';
import type { Coin, Tally } from '@/types';
import numeral from 'numeral';
import { defineStore } from 'pinia';
@@ -175,6 +175,7 @@ export const useIndexModule = defineStore('module-index', {
color: 'warning',
icon: 'mdi-lock',
stats: formatter.formatTokenAmount({
// @ts-ignore
amount: this.pool.bonded_tokens,
denom: staking.params.bond_denom,
}),
@@ -192,8 +193,9 @@ export const useIndexModule = defineStore('module-index', {
color: 'primary',
icon: 'mdi-bank',
stats: formatter.formatTokens(
// @ts-ignore
this.communityPool?.filter(
(x) => x.denom === staking.params.bond_denom
(x: Coin) => x.denom === staking.params.bond_denom
)
),
change: 0,
@@ -203,6 +205,7 @@ export const useIndexModule = defineStore('module-index', {
coingeckoId() {
this.tickerIndex = 0;
// @ts-ignore
const [firstAsset] = this.blockchain?.assets || [];
return firstAsset.coingecko_id
}