mirror of
https://github.com/luxfi/dex.git
synced 2026-09-24 00:26:31 +00:00
Add comprehensive unit tests for api package: - IPRateLimiter tests (NewIPRateLimiter, Allow, cleanup, concurrent access) - getClientIP tests (X-Forwarded-For variants, RemoteAddr with/without port) - JSONRPCServer rate limiting tests - processMessage tests (invalid type, unknown type, various message types) - Handler edge cases (missing fields, invalid formats, authentication states) - notifyLiquidation tests (client found, not found, sell side) - broadcastToSubscribers tests (no clients, full channel) - Concurrent access tests for rate limiter and server metrics Coverage improved from 70.5% to 79.9%. Remaining uncovered code (readPump, writePump, HandleConnection, Start, marketDataBroadcaster, positionMonitor, metricsReporter) requires integration testing with actual WebSocket connections.