Payment Fixes:
- Prevent credits going negative with WHERE credits >= $1 check
- completeGame now uses recorded payment_mode from game record instead of global gameMode
- Add duplicate payout prevention by checking for existing payouts before processing
Dead Code Cleanup:
- Remove unused MoneroPayService (WalletRPCService is the actual service)
- Remove legacy MoneroPay references from comments
Tests:
- Add 50 comprehensive payment/payout tests (payment_payout_comprehensive.test.js)
- Expand WalletRPCService tests (4 -> 31 tests)
- Total: 106 tests passing across 10 test suites
Documentation:
- Update TODO.md with recent fixes and correct test counts
- Update migration comments to reflect actual wallet service used
- Replace deprecated 'request' with axios in rpccalls.js
- Remove 'request' from package.json (was only used in one file)
- Update node-pg-migrate to ^8.0.4 to fix glob vulnerability
- Run npm audit fix to resolve axios, form-data, js-yaml vulnerabilities
- Fix test/index.js to use correct path for rpccalls import
- Add Node.js installation and npm audit instructions to README
- Add deploy key setup instructions to README
Before: 8 vulnerabilities (1 low, 2 moderate, 3 high, 2 critical)
After: 0 vulnerabilities