mod exchange_test; use tracing::{instrument}; use exchanges::bitmart_swap_ws::BitMartSwapSubscribeType; use standard::exchange::ExchangeEnum; use crate::exchange_test::{test_new_exchange_wss}; const SYMBOL: &str = "XRP_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 bitmart_subscribe_type = vec![ BitMartSwapSubscribeType::PuFuturesDepth ]; test_new_exchange_wss(ExchangeEnum::BitmartSwap, SYMBOL, bitmart_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 bitmart_subscribe_type = vec![ BitMartSwapSubscribeType::PrFuturesBalances ]; test_new_exchange_wss(ExchangeEnum::BitmartSwap, SYMBOL, bitmart_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 bitmart_subscribe_type = vec![ BitMartSwapSubscribeType::PrFuturesPositions ]; test_new_exchange_wss(ExchangeEnum::BitmartSwap, SYMBOL, bitmart_subscribe_type, "position").await; } // 测试订阅Ticker信息 #[tokio::test(flavor = "multi_thread", worker_threads = 4)] #[instrument(level = "TRACE")] async fn test_get_wss_ticker() { global::log_utils::init_log_with_trace(); let bitmart_subscribe_type = vec![ BitMartSwapSubscribeType::PuFuturesTicker ]; test_new_exchange_wss(ExchangeEnum::BitmartSwap, SYMBOL, bitmart_subscribe_type, "ticker").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 bitmart_subscribe_type = vec![ BitMartSwapSubscribeType::PrFuturesOrders ]; test_new_exchange_wss(ExchangeEnum::BitmartSwap, SYMBOL, bitmart_subscribe_type, "orders").await; }