mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-06-13 10:01:02 +00:00
debug: add console logs for trust score calculation
This commit is contained in:
+12
-1
@@ -781,7 +781,16 @@ export async function getFrontendTrustScore(
|
|||||||
|
|
||||||
const stakingScore = stakingResult.score;
|
const stakingScore = stakingResult.score;
|
||||||
|
|
||||||
// If staking score is 0, trust score is 0 (matches pallet logic)
|
console.log('🔍 getFrontendTrustScore debug:', {
|
||||||
|
address: address.slice(0, 8) + '...',
|
||||||
|
stakingScore,
|
||||||
|
referralScore,
|
||||||
|
perwerdeScore,
|
||||||
|
tikiScore,
|
||||||
|
stakedHez: stakingResult.stakedHez,
|
||||||
|
});
|
||||||
|
|
||||||
|
// Ger staking 0 be, trust jî 0 be (matches pallet logic)
|
||||||
if (stakingScore === 0) {
|
if (stakingScore === 0) {
|
||||||
return {
|
return {
|
||||||
...emptyResult,
|
...emptyResult,
|
||||||
@@ -803,6 +812,8 @@ export async function getFrontendTrustScore(
|
|||||||
// trust_score = (staking * weighted_sum) / 100
|
// trust_score = (staking * weighted_sum) / 100
|
||||||
const trustScore = Math.floor((stakingScore * weightedSum) / SCORE_MULTIPLIER_BASE);
|
const trustScore = Math.floor((stakingScore * weightedSum) / SCORE_MULTIPLIER_BASE);
|
||||||
|
|
||||||
|
console.log('✅ Trust score calculated:', { weightedSum, trustScore });
|
||||||
|
|
||||||
return {
|
return {
|
||||||
trustScore,
|
trustScore,
|
||||||
stakingScore,
|
stakingScore,
|
||||||
|
|||||||
Reference in New Issue
Block a user