mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-04-24 13:07:56 +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:
@@ -10,7 +10,7 @@ import { supabase } from '@/lib/supabase';
|
||||
import { User, Mail, Phone, Globe, MapPin, Calendar, Shield, AlertCircle, ArrowLeft, Award, Users, TrendingUp, UserMinus, Play, Loader2 } from 'lucide-react';
|
||||
import { useToast } from '@/hooks/use-toast';
|
||||
import { fetchUserTikis, getPrimaryRole, getTikiDisplayName, getTikiColor, getTikiEmoji, getUserRoleCategories, getAllTikiNFTDetails, generateCitizenNumber, type TikiNFTDetails } from '@pezkuwi/lib/tiki';
|
||||
import { getAllScoresWithFallback, getStakingScoreStatus, startScoreTracking, type UserScores, type StakingScoreStatus, formatDuration } from '@pezkuwi/lib/scores';
|
||||
import { getAllScores, getStakingScoreStatus, startScoreTracking, type UserScores, type StakingScoreStatus, formatDuration } from '@pezkuwi/lib/scores';
|
||||
import { web3FromAddress } from '@pezkuwi/extension-dapp';
|
||||
import { getKycStatus } from '@pezkuwi/lib/kyc';
|
||||
import { ReferralDashboard } from '@/components/referral/ReferralDashboard';
|
||||
@@ -111,7 +111,7 @@ export default function Dashboard() {
|
||||
// Fetch all scores with frontend fallback (until runtime upgrade)
|
||||
// - Trust, referral, tiki: People Chain (on-chain)
|
||||
// - Staking: Relay Chain with frontend fallback
|
||||
const allScores = await getAllScoresWithFallback(peopleApi, api, selectedAccount.address);
|
||||
const allScores = await getAllScores(peopleApi, selectedAccount.address);
|
||||
setScores(allScores);
|
||||
|
||||
// Fetch staking score tracking status
|
||||
|
||||
Reference in New Issue
Block a user