Skip to content

Commit

Permalink
zb.com has shut down
Browse files Browse the repository at this point in the history
  • Loading branch information
soulmachine committed Jul 13, 2024
1 parent 329e6ef commit 1d4597f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions crypto-pair/src/exchanges/zb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,15 @@ pub(crate) fn get_market_type(symbol: &str) -> MarketType {
let lowercase = symbol.to_lowercase();
if lowercase.as_str() == symbol { MarketType::Spot } else { MarketType::LinearSwap }
}

#[cfg(test)]
mod tests {
use super::normalize_pair;

#[test]
fn test_normalize_pair() {
assert_eq!(Some("BTC/USDT".to_string()), normalize_pair("btc_usdt"));
assert_eq!(Some("BTC/USDT".to_string()), normalize_pair("btcusdt"));
assert_eq!(Some("BTC/USDT".to_string()), normalize_pair("BTC_USDT"));
}
}
2 changes: 2 additions & 0 deletions crypto-pair/tests/zb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@ fn fetch_swap_markets_all() -> Vec<SwapMarket> {
}

#[test]
#[ignore = "zb.com has shut down"]
fn verify_spot_symbols() {
assert_eq!(Some("BTC/USDT".to_string()), normalize_pair("btc_usdt", EXCHANGE_NAME));
assert_eq!(Some("BTC/USDT".to_string()), normalize_pair("btcusdt", EXCHANGE_NAME));
}

#[test]
#[ignore = "zb.com has shut down"]
fn verify_swap_symbols() {
let markets = fetch_swap_markets_all();
for market in markets.iter() {
Expand Down

0 comments on commit 1d4597f

Please sign in to comment.