Skip to main content

Game Wallet & Sync — Test Cases

Feature version: v1.0
Reference doc: Deposit Technical Reference — Game Wallet Sync
Result notation: ✅ Pass | ❌ Fail | ⏭ Skip | 🐛 Fail + bug report


Changelog

DateVersionChangeAuthor
2026-05-10v1.0Initial creation

TC-GAMEWALLET-001 — Two-phase DB transaction sync 🆕 NEW

Precondition: A direct-to-game transaction is in pending state. The game provider API is operational.

#DescriptionStepsExpected ResultActual Result
1Transaction 1: lock + set status to processingMonitor DB when sync beginsGameWalletTransaction.status = 'processing'
2External API succeeds → Transaction 2 completesGame API returns successstatus = 'completed'; walletBalance updated correctly
3External API fails → failed in a separate transactionSimulate game API errorGameWalletTransaction → 'failed' (separate DB transaction; Txn 1 is not rolled back)
4Balance changes between Txn 1 and Txn 2 → Txn 2 abortsModify walletBalance after Txn 1 lock is releasedTxn 2 detects inconsistency → does not commit
5Idempotency — sync triggered twiceCall processSingleGameWalletTransactionSync() a second time for the same transactionNo double-credit (second call is skipped by idempotency guard)

TC-GAMEWALLET-002 — syncStatus flow 🆕 NEW

#DescriptionStepsExpected ResultActual Result
1Wallet-only deposit has syncStatus = 'none'Complete a deposit with no game selectedTransaction syncStatus = 'none'
2Direct-to-game: correct status progressionComplete a direct-to-game deposit and successful syncsyncStatus: nonependingin_progresscompleted
3Retry increments retryCountSync fails → retry worker picks it upretryCount increments; nextRetryAt is set for the next attempt
4Persistent game API errors → failedSimulate continuous game provider API errorssyncStatus = 'failed' after all retry attempts