Problem
StellarService and PathPaymentService call Stellar RPC but have no test coverage, risking network call failures at runtime.
Scope
Add tests for StellarService:
- getAccountBalance(): fetches USDC balance for valid address, handles account not found (returns 0), handles network timeouts gracefully
- Keypair validation: only valid Ed25519 keys accepted
- Network error handling: retry logic (if implemented), fallback behavior
Add tests for PathPaymentService:
- getPathPaymentQuote(): given source amount/asset, returns valid path payment quotes
- Multi-hop paths: correctly identifies optimal conversion path (NGN → intermediary → USDC)
- Error handling: no path exists (illiquid pair), network timeouts
- Response parsing: quote amount extracted correctly
Add tests for WalletService:
- getUsdcBalance(): delegates to StellarService, correct asset code passed
Acceptance Criteria
- Mock Stellar SDK RpcServer for integration tests
- Test happy path: valid address returns balance
- Test error paths: invalid address (not found on ledger), malformed address (invalid base32)
- Test network errors: timeout, 503 Service Unavailable, connection refused
- Test edge cases: zero balance, extremely large balance (>1B USDC)
- Verify RPC calls are rate-limited appropriately
Estimated Effort
Medium (2-3 half-days)
Problem
StellarService and PathPaymentService call Stellar RPC but have no test coverage, risking network call failures at runtime.
Scope
Add tests for StellarService:
Add tests for PathPaymentService:
Add tests for WalletService:
Acceptance Criteria
Estimated Effort
Medium (2-3 half-days)