Skip to content

Fix: no way to list all active matches — no global match index #289

@yahia008

Description

@yahia008

Priority: Low
Estimated Time: 2 hours

Description:
There is no on-chain index of all match IDs. Frontends must iterate from 0 to MatchCount and call get_match for each, which is expensive and fragile if any match has expired from storage.

Tasks:

  • Add DataKey::ActiveMatches storing a Vec<u64>
  • Append on create_match, remove on cancel_match and submit_result
  • Add get_active_matches(env: Env) -> Vec<u64> read function
  • Add test asserting the index is updated correctly through the match lifecycle

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