Skip to content

Fix: no way to query all matches for a player #284

@yahia008

Description

@yahia008

Priority: Low
Estimated Time: 2 hours

Description:
There is no index mapping a player address to their match IDs. Frontends must scan all match IDs to find a player's matches, which is impractical at scale.

Tasks:

  • Add DataKey::PlayerMatches(Address) storing a Vec<u64> of match IDs
  • Update create_match to append the new match ID to both players' index entries
  • Add get_player_matches(env: Env, player: Address) -> Vec<u64> read function
  • Add test asserting the index is populated correctly after match creation

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave programenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions