mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-12-15 20:31:43 +00:00
chore: remove unused code
This commit is contained in:
@@ -87,20 +87,6 @@ async def fetch_ohlcv(
|
||||
return df
|
||||
|
||||
|
||||
def symbol_ccxt_to_binance(symbol: str) -> str:
|
||||
"""
|
||||
Convert ccxt symbol notation to binance notation
|
||||
e.g. BTC/USDT -> BTCUSDT, BTC/USDT:USDT -> BTCUSDT
|
||||
"""
|
||||
if ":" in symbol:
|
||||
parts = symbol.split(":")
|
||||
if len(parts) != 2:
|
||||
raise ValueError(f"Cannot recognize symbol: {symbol}")
|
||||
return parts[0].replace("/", "")
|
||||
else:
|
||||
return symbol.replace("/", "")
|
||||
|
||||
|
||||
def concat(dfs) -> DataFrame:
|
||||
if all(df is None for df in dfs):
|
||||
return DataFrame()
|
||||
|
||||
@@ -16,7 +16,6 @@ from freqtrade.exchange.binance_public_data import (
|
||||
Http404,
|
||||
fetch_ohlcv,
|
||||
get_daily_ohlcv,
|
||||
symbol_ccxt_to_binance,
|
||||
zip_name,
|
||||
)
|
||||
from freqtrade.util.datetime_helpers import dt_ts, dt_utc
|
||||
@@ -295,10 +294,3 @@ async def test_get_daily_ohlcv(mocker, testdatadir):
|
||||
)
|
||||
df = await get_daily_ohlcv("spot", symbol, timeframe, date, session)
|
||||
assert isinstance(df, zipfile.BadZipFile)
|
||||
|
||||
|
||||
def test_symbol_ccxt_to_binance():
|
||||
assert symbol_ccxt_to_binance("BTC/USDT") == "BTCUSDT"
|
||||
assert symbol_ccxt_to_binance("BTC/USDT:USDT") == "BTCUSDT"
|
||||
with pytest.raises(ValueError):
|
||||
assert symbol_ccxt_to_binance("BTC:USDT:USDT") == "BTCUSDT"
|
||||
|
||||
Reference in New Issue
Block a user