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
Priority: Low
Estimated Time: 2 hours
Description:
There is no on-chain index of all match IDs. Frontends must iterate from
0toMatchCountand callget_matchfor each, which is expensive and fragile if any match has expired from storage.Tasks:
DataKey::ActiveMatchesstoring aVec<u64>create_match, remove oncancel_matchandsubmit_resultget_active_matches(env: Env) -> Vec<u64>read function