Skip to content

Comments

feat: implement get_top_winners function for market contract#147

Open
GoodnessJohn wants to merge 1 commit intoNetwalls:mainfrom
GoodnessJohn:feature/get-top-winners-68
Open

feat: implement get_top_winners function for market contract#147
GoodnessJohn wants to merge 1 commit intoNetwalls:mainfrom
GoodnessJohn:feature/get-top-winners-68

Conversation

@GoodnessJohn
Copy link

  • Add get_top_winners() function that returns top N winners sorted by payout
  • Validates market is in RESOLVED state before execution
  • Handles edge cases: zero limit, no winners, limit exceeds total
  • Implements deterministic sorting using bubble sort
  • Add test helper test_get_top_winners_with_users() for comprehensive testing
  • Add 8 comprehensive test cases covering all scenarios
  • Include detailed documentation and quick reference guide

Closes #68

- Add get_top_winners() function that returns top N winners sorted by payout
- Validates market is in RESOLVED state before execution
- Handles edge cases: zero limit, no winners, limit exceeds total
- Implements deterministic sorting using bubble sort
- Add test helper test_get_top_winners_with_users() for comprehensive testing
- Add 8 comprehensive test cases covering all scenarios
- Include detailed documentation and quick reference guide

Closes Netwalls#68
@GoSTEAN
Copy link
Contributor

GoSTEAN commented Feb 21, 2026

@GoodnessJohn resolve conflict

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Contract] Implement get_market_leaderboard

2 participants