use std::time::Duration;
use digdigdig3::l3::open::crypto::dex::lighter::LighterConnector;
use digdigdig3::core::{AccountType, Symbol};
use digdigdig3::MarketData;
#[tokio::test]
async fn get_klines_does_not_block_runtime() {
let connector = LighterConnector::public(false)
.await
.expect("LighterConnector::public should construct without error");
let symbol = Symbol::new("ETH", "USDC");
let symbol_str = symbol.to_concat();
let result = tokio::time::timeout(
Duration::from_secs(5),
connector.get_klines(&symbol_str, "1h", Some(10), AccountType::FuturesCross, None),
)
.await;
assert!(
result.is_ok(),
"get_klines blocked the tokio runtime for >5s — rate_limit_wait spin detected"
);
}
#[tokio::test]
async fn ping_does_not_block_runtime() {
let connector = LighterConnector::public(false)
.await
.expect("LighterConnector::public should construct without error");
let result = tokio::time::timeout(
Duration::from_secs(5),
connector.ping(),
)
.await;
assert!(
result.is_ok(),
"ping blocked the tokio runtime for >5s"
);
}