Skip to content

Conversation

@Gbangbolaoluwagbemiga
Copy link

This PR implements comprehensive test cases for the User Balance Management system, targeting 95%+ coverage for deposits, withdrawals, and claims. It also updates the voting logic to production standards by enabling live token transfers.

Key Changes

New Tests: Added 24 test cases in test.rs covering:
Voting deposits and balance tracking.
Winnings claims and fee calculations.
Security validation (preventing double claims, unauthorized access).
Edge cases (zero balance, minimum stakes).

Bug Fix: Fixed test_claim_losing_outcome to correctly verify that losing claims are marked as processed.

Screenshot

image

Setup

Run tests with: cargo test --lib

Issue Linked
Closes #207

@greatest0fallt1me
Copy link
Contributor

@Gbangbolaoluwagbemiga Please resolve the conflicts

@Gbangbolaoluwagbemiga
Copy link
Author

@greatest0fallt1me, please review and merge, will appreciate picking up more issues, love the codebase and isea behind this

@Gbangbolaoluwagbemiga Gbangbolaoluwagbemiga force-pushed the test/user-balance-management-tests branch from 19af03b to 0802906 Compare January 23, 2026 14:05
@greatest0fallt1me
Copy link
Contributor

@Gbangbolaoluwagbemiga Please resolve the conflicts

@Gbangbolaoluwagbemiga
Copy link
Author

@greatest0fallt1me conflicts resolved

@Gbangbolaoluwagbemiga
Copy link
Author

@greatest0fallt1me cli build issues has been fixed too, please leave a good review.

Ready to take on more issues.

@greatest0fallt1me
Copy link
Contributor

@Gbangbolaoluwagbemiga, please check if the pipeline is failing.

@Gbangbolaoluwagbemiga Gbangbolaoluwagbemiga force-pushed the test/user-balance-management-tests branch from c903882 to d51a73b Compare January 26, 2026 15:44
@greatest0fallt1me
Copy link
Contributor

@Gbangbolaoluwagbemiga Please resolve the conflicts

- Resolved conflicts in admin.rs, lib.rs, markets.rs, test.rs

- Added global warning suppressions to fix compilation errors

- Fixed duplicate test definitions

- Ensured admin permissions logic logic is correct
@greatest0fallt1me
Copy link
Contributor

@Gbangbolaoluwagbemiga

1 similar comment
@greatest0fallt1me
Copy link
Contributor

@Gbangbolaoluwagbemiga

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.

test: add comprehensive tests for user balance management

2 participants