mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-04-22 09:07:55 +00:00
refactor(scores): remove frontend fallback, read all scores from blockchain
Remove all frontend staking/trust score calculation and localStorage fallback code. All scores now read directly from People Chain pallets (pezpallet-trust, pezpallet-referral, pezpallet-tiki). Trust pallet computes composite score on-chain.
This commit is contained in:
@@ -4,7 +4,7 @@ import { ChevronRight, Shield } from 'lucide-react';
|
||||
import { usePezkuwi } from '../contexts/PezkuwiContext';
|
||||
import { useWallet } from '../contexts/WalletContext'; // Import useWallet
|
||||
import { formatBalance } from '@pezkuwi/lib/wallet';
|
||||
import { getTrustScoreWithFallback } from '@pezkuwi/lib/scores';
|
||||
import { getTrustScore } from '@pezkuwi/lib/scores';
|
||||
|
||||
const HeroSection: React.FC = () => {
|
||||
const { t } = useTranslation();
|
||||
@@ -25,12 +25,9 @@ const HeroSection: React.FC = () => {
|
||||
if (selectedAccount?.address) {
|
||||
try {
|
||||
// Use frontend fallback for trust score
|
||||
const trustResult = await getTrustScoreWithFallback(
|
||||
peopleApi || null,
|
||||
api,
|
||||
selectedAccount.address
|
||||
);
|
||||
currentTrustScore = trustResult.trustScore;
|
||||
if (peopleApi) {
|
||||
currentTrustScore = await getTrustScore(peopleApi, selectedAccount.address);
|
||||
}
|
||||
} catch (err) {
|
||||
if (import.meta.env.DEV) console.warn('Failed to fetch trust score:', err);
|
||||
currentTrustScore = 0;
|
||||
|
||||
Reference in New Issue
Block a user