Skip to content

test: add comprehensive test coverage for issues #985, #1053, #1095, #1096 - #1199

Merged
famvilianity-eng merged 4 commits into
StellarCheckMate:mainfrom
owennashdev-ctrl:feature/add-missing-test-coverage-985-1053-1095-1096
Jul 29, 2026
Merged

test: add comprehensive test coverage for issues #985, #1053, #1095, #1096#1199
famvilianity-eng merged 4 commits into
StellarCheckMate:mainfrom
owennashdev-ctrl:feature/add-missing-test-coverage-985-1053-1095-1096

Conversation

@owennashdev-ctrl

Copy link
Copy Markdown
Contributor

Summary

This PR adds comprehensive test coverage for four critical test gaps identified in the escrow contract:

Test Files Added

  • contracts/escrow/src/tests/match_validation.rs - 7 tests for match creation and deposit validation
  • contracts/escrow/src/tests/balance_history_edge_cases.rs - 6 tests for balance tracking and snapshots
  • contracts/escrow/src/tests/fee_calculation_scenarios.rs - 6 tests for fee calculation logic
  • contracts/escrow/src/tests/oracle_validation.rs - 8 tests for oracle authorization and result submission

Test Coverage

Total: 27 new unit tests covering critical contract boundaries and edge cases

Closes #985
Closes #1053
Closes #1095
Closes #1096

- 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
@drips-wave

drips-wave Bot commented Jul 28, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

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

Labels

None yet

Projects

None yet

2 participants