MindBlockLabs/mindBlock_app

Implement Sorted Leaderboard with Persistent Player Index

Open

#292 geöffnet am 18. März 2026

Auf GitHub ansehen
 (4 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)TypeScript (78 Forks)auto 404
GrantFox OSSMaybe RewardedOfficial Campaign | FWC26enhancementgood first issuesoroban

Repository-Metriken

Stars
 (2 Stars)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

Description:

The get_leaderboard() function currently returns an empty vector and serves as a placeholder. This needs to be fully implemented to support the game's social competition features.

Current Behavior:

get_leaderboard() accepts a limit: u32 parameter but always returns an empty Vec regardless of registered players or their XP. Expected Behavior: The function should return the top N players (where N = limit) sorted by XP in descending order.

Requirements:

  • Maintain a registry of all player addresses whenever a new player registers
  • The leaderboard query should respect the limit parameter
  • Players should be ranked by their current XP value
  • The implementation must work within Soroban's storage constraints — note that iterating all storage keys directly is not supported on Soroban; a separate index structure must be maintained

Acceptance Criteria:

  • get_leaderboard(5) returns the top 5 players by XP
  • Results are sorted highest XP first
  • A new player registration updates the player index
  • A test covering leaderboard ordering is included

Contributor Guide