test: add comprehensive test coverage for issues #985, #1053, #1095, #1096 - #1199
Merged
famvilianity-eng merged 4 commits intoJul 29, 2026
Conversation
- Test zero stake match rejection - Test same player match rejection - Test excessive stake rejection - Test empty game_id rejection - Test insufficient balance deposit rejection - Test deposit on completed match rejection - Test duplicate deposit rejection Closes StellarCheckMate#985
- Test balance snapshot after deposit - Test player balance history monotonic increase - Test get_escrow_balance for uninitialized match - Test player balance snapshot on draw - Test balance snapshot records correct amounts - Test player balance history with multiple matches Closes StellarCheckMate#1053
- Test cancellation fee calculation correctness - Test zero cancellation fee acceptance - Test high cancellation fee allowance - Test fee applied to deposited amount - Test token swap fee considerations - Test tier-based fee adjustment Closes StellarCheckMate#1095
- Test submit_result only by oracle authorization - Test submit_result with valid winner - Test submit_result with draw - Test submit_result on inactive match rejection - Test submit_result invalid winner rejection - Test duplicate oracle result rejection - Test oracle change authorization - Test oracle can submit results for different matches Closes StellarCheckMate#1096
|
@owennashdev-ctrl Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds comprehensive test coverage for four critical test gaps identified in the escrow contract:
cancel_matchby non-player is rejected #1095: Fee calculation scenarios (cancellation fee correctness, zero/high fee handling, token swap fee considerations, tier-based fee adjustments)depositafter match is cancelled returns error #1096: Oracle validation tests (authorization checks, valid/invalid winners, inactive match handling, duplicate submission rejection, oracle management)Test Files Added
contracts/escrow/src/tests/match_validation.rs- 7 tests for match creation and deposit validationcontracts/escrow/src/tests/balance_history_edge_cases.rs- 6 tests for balance tracking and snapshotscontracts/escrow/src/tests/fee_calculation_scenarios.rs- 6 tests for fee calculation logiccontracts/escrow/src/tests/oracle_validation.rs- 8 tests for oracle authorization and result submissionTest Coverage
Total: 27 new unit tests covering critical contract boundaries and edge cases
Closes #985
Closes #1053
Closes #1095
Closes #1096