From df5f69214f127773f2b34c6322ab274bfc867e0b Mon Sep 17 00:00:00 2001 From: chary <57086313+charymalloju@users.noreply.github.com> Date: Fri, 15 Mar 2024 11:11:50 +0530 Subject: [PATCH] Chary/validator profile fix (#1198) * fix witval validator issue * fix totaldelegations and delegator fix * fix lint issues --- .../[validator]/ValidatorProfile.tsx | 32 +++++++++++++------ 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/frontend/src/app/(routes)/staking/validator/[validator]/ValidatorProfile.tsx b/frontend/src/app/(routes)/staking/validator/[validator]/ValidatorProfile.tsx index 59a7701bd..5e44842a9 100644 --- a/frontend/src/app/(routes)/staking/validator/[validator]/ValidatorProfile.tsx +++ b/frontend/src/app/(routes)/staking/validator/[validator]/ValidatorProfile.tsx @@ -16,7 +16,9 @@ const ValidatorProfile = ({ moniker }: { moniker: string }) => { const tabs = ['Profile', 'Announcements', 'Inbox', 'Notices']; const selectedTab = 'profile'; useInitAllValidator(); - const { getChainwiseValidatorInfo, getValidatorStats } = + const { getChainwiseValidatorInfo, + getOasisValidatorInfo, + getPolygonValidatorInfo, getValidatorStats } = useGetValidatorInfo(); const { chainWiseValidatorData, @@ -24,17 +26,27 @@ const ValidatorProfile = ({ moniker }: { moniker: string }) => { validatorIdentity, validatorWebsite, } = getChainwiseValidatorInfo({ moniker }); - const { - totalDelegators, - totalStaked, - avgCommission, - activeNetworks, - totalNetworks, - } = getValidatorStats({ + + const validatorStatsResult = getValidatorStats({ data: chainWiseValidatorData, moniker: moniker, }); + const { avgCommission, + activeNetworks, + totalNetworks } = validatorStatsResult; + + let { totalDelegators, + totalStaked, } = validatorStatsResult + + const { totalStakedInUSD: totalPolygonStaked, totalDelegators: totalPolygonDelegators } = getPolygonValidatorInfo() + const { totalStakedInUSD: totalOasisStaked, totalDelegators: totalOasisDelegator } = getOasisValidatorInfo() + + totalStaked += totalPolygonStaked || 0 + totalStaked += totalOasisStaked || 0 + totalDelegators += totalPolygonDelegators + totalDelegators += totalOasisDelegator + return (