Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade tokio to 1.0 #156

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ futures = "0.3.5"
hex = "0.4.2"
hmac = "0.8.1"
log = "0.4.8"
reqwest = { version = "0.10", features = ["json", "blocking"] }
reqwest = { version = "0.11", features = ["json", "blocking"] }
rust_decimal = "1.7.0"
sugar = "0.2.0"
serde = { version = "1.0.114", features = ["derive"] }
serde_json = "1.0.55"
serde_urlencoded = "0.6.1"
thiserror = "1.0.20"
tokio = { version = "0.2", features = ["full"] }
tokio-tungstenite = { version = "0.10.1", features = ["tls"] }
tungstenite = "0.11.0"
tokio = { version = "1", features = ["full"] }
tokio-tungstenite = { version = "0.13.0", features = ["tls"] }
tungstenite = "0.12.0"
sha2 = "0.9.1"
url = "2.1.1"
derive_more = "0.99"
Expand Down
18 changes: 9 additions & 9 deletions tests/apis/binance/websocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,63 +21,63 @@ async fn test_subscription_callback(websocket: BinanceWebsocket, sub: BinanceSub
rx.recv().expect("Couldn't receive sync message.");
}

#[tokio::test(core_threads = 2)]
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn aggregate_trade() {
let websocket = init().await;
let sub = BinanceSubscription::AggregateTrade("bnbbtc".to_string());
test_subscription_callback(websocket, sub).await;
}

#[tokio::test(core_threads = 2)]
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn candlestick() {
let websocket = init().await;
let sub = BinanceSubscription::Candlestick("bnbbtc".to_string(), "1m".to_string());
test_subscription_callback(websocket, sub).await;
}

#[tokio::test(core_threads = 2)]
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn depth() {
let websocket = init().await;
let sub = BinanceSubscription::Depth("bnbbtc".to_string(), Some(1));
test_subscription_callback(websocket, sub).await;
}

#[tokio::test(core_threads = 2)]
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn mini_ticker() {
let websocket = init().await;
let sub = BinanceSubscription::MiniTicker("bnbbtc".to_string());
test_subscription_callback(websocket, sub).await;
}

#[tokio::test(core_threads = 2)]
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn mini_ticker_all() {
let websocket = init().await;
let sub = BinanceSubscription::MiniTickerAll;
test_subscription_callback(websocket, sub).await;
}

#[tokio::test(core_threads = 2)]
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn order_book() {
let websocket = init().await;
let sub = BinanceSubscription::OrderBook("bnbbtc".to_string(), 10);
test_subscription_callback(websocket, sub).await;
}

#[tokio::test(core_threads = 2)]
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn ticker() {
let websocket = init().await;
let sub = BinanceSubscription::Ticker("bnbbtc".to_string());
test_subscription_callback(websocket, sub).await;
}

#[tokio::test(core_threads = 2)]
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn ticker_all() {
let websocket = init().await;
let sub = BinanceSubscription::TickerAll;
test_subscription_callback(websocket, sub).await;
}

#[tokio::test(core_threads = 2)]
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn trade() {
let websocket = init().await;
let sub = BinanceSubscription::Trade("bnbbtc".to_string());
Expand Down
2 changes: 1 addition & 1 deletion tests/apis/coinbase/websocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async fn test_subscription_callback(
.expect("Couldn't receive sync message.");
}

#[tokio::test(core_threads = 2)]
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn order_book() {
let websocket = init().await;
let sub = CoinbaseSubscription::Level2("BTC-USD".to_string());
Expand Down
4 changes: 2 additions & 2 deletions tests/binance/ws_callbacks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ async fn test_subscription_callback(websocket: OpenLimitsWs<BinanceWebsocket>, s
rx.recv().expect("Couldn't receive sync message.");
}

#[tokio::test(core_threads = 2)]
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn orderbook() {
let ws = init().await;
let sub = Subscription::OrderBookUpdates("bnbbtc".to_string());
test_subscription_callback(ws, sub).await;
}

#[tokio::test(core_threads = 2)]
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn trades() {
let ws = init().await;
let sub = Subscription::Trades("btcusdt".to_string());
Expand Down
4 changes: 2 additions & 2 deletions tests/binance/ws_streams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use openlimits::{
model::websocket::Subscription,
};

#[tokio::test(core_threads = 2)]
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn orderbook() {
let ws = init().await;
let s = ws
Expand All @@ -17,7 +17,7 @@ async fn orderbook() {
print!("{:?}", ob);
}

#[tokio::test(core_threads = 2)]
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn trades() {
let ws = init().await;
let s = ws
Expand Down
4 changes: 2 additions & 2 deletions tests/nash/websocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ async fn test_subscription_callback(websocket: OpenLimitsWs<NashWebsocket>, sub:
rx.recv().expect("Couldn't receive sync message.");
}

#[tokio::test(core_threads = 2)]
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn orderbook() {
let client = init().await;
let sub = Subscription::OrderBookUpdates("btc_usdc".to_string());
test_subscription_callback(client, sub).await;
}

#[tokio::test(core_threads = 2)]
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn trades() {
let client = init().await;
let sub = Subscription::Trades("btc_usdc".to_string());
Expand Down