mod exchange_test; use tracing::{instrument}; use exchanges::htx_swap_ws::HtxSwapSubscribeType; use standard::exchange::ExchangeEnum; use crate::exchange_test::{test_new_exchange_wss}; const SYMBOL: &str = "USTC_USDT"; // 测试订阅深度订阅 #[tokio::test(flavor = "multi_thread", worker_threads = 4)] #[instrument(level = "TRACE")] async fn test_get_wss_depth() { global::log_utils::init_log_with_trace(); let htx_subscribe_type = vec![ HtxSwapSubscribeType::PuFuturesDepth ]; test_new_exchange_wss(ExchangeEnum::HtxSwap, SYMBOL, htx_subscribe_type, "depth").await; } // 测试订阅Account信息 #[tokio::test(flavor = "multi_thread", worker_threads = 4)] #[instrument(level = "TRACE")] async fn test_get_wss_account() { global::log_utils::init_log_with_trace(); let htx_subscribe_type = vec![ HtxSwapSubscribeType::PrFuturesBalances ]; test_new_exchange_wss(ExchangeEnum::HtxSwap, SYMBOL, htx_subscribe_type, "account").await; } // 测试订阅Position信息 #[tokio::test(flavor = "multi_thread", worker_threads = 4)] #[instrument(level = "TRACE")] async fn test_get_wss_position() { global::log_utils::init_log_with_trace(); let htx_subscribe_type = vec![ HtxSwapSubscribeType::PrFuturesPositions ]; test_new_exchange_wss(ExchangeEnum::HtxSwap, SYMBOL, htx_subscribe_type, "position").await; } // 测试订阅Orders信息 #[tokio::test(flavor = "multi_thread", worker_threads = 4)] #[instrument(level = "TRACE")] async fn test_get_wss_orders() { global::log_utils::init_log_with_trace(); let htx_subscribe_type = vec![ HtxSwapSubscribeType::PrFuturesOrders ]; test_new_exchange_wss(ExchangeEnum::HtxSwap, SYMBOL, htx_subscribe_type, "orders").await; }