mirror of
https://github.com/luxfi/dex.git
synced 2026-09-24 00:26:31 +00:00
Added comprehensive unit and integration tests for TraderClient: Unit tests (without WebSocket): - Message handlers (order, position, price, trade, orderbook, balance, error) - State management (orders, positions, prices, trades storage) - Callback registration and execution - Channel getters and update channels - Missing field handling Integration tests (with mock WebSocket server): - PlaceOrder, CancelOrder, ModifyOrder (authenticated path) - OpenMarginPosition with server response - ClosePosition, ModifyLeverage - Subscribe/Unsubscribe with symbols array - VaultDeposit, VaultWithdraw - Lending operations (Supply, Borrow, Repay) - Disconnect - handleMessages loop Coverage improved from 64.2% to 88.2% of statements.