Fix compat-test failures due to wrong currency

This commit is contained in:
Matthias 2022-01-08 11:09:25 +01:00
parent 2fb9e7940a
commit dd37e5cfb8

View File

@ -21,22 +21,26 @@ from tests.conftest import get_default_conf_usdt
EXCHANGES = { EXCHANGES = {
'bittrex': { 'bittrex': {
'pair': 'BTC/USDT', 'pair': 'BTC/USDT',
'stake_currency': 'USDT',
'hasQuoteVolume': False, 'hasQuoteVolume': False,
'timeframe': '1h', 'timeframe': '1h',
}, },
'binance': { 'binance': {
'pair': 'BTC/USDT', 'pair': 'BTC/USDT',
'stake_currency': 'USDT',
'hasQuoteVolume': True, 'hasQuoteVolume': True,
'timeframe': '5m', 'timeframe': '5m',
'futures': True, 'futures': True,
}, },
'kraken': { 'kraken': {
'pair': 'BTC/USDT', 'pair': 'BTC/USDT',
'stake_currency': 'USDT',
'hasQuoteVolume': True, 'hasQuoteVolume': True,
'timeframe': '5m', 'timeframe': '5m',
}, },
'ftx': { 'ftx': {
'pair': 'BTC/USD', 'pair': 'BTC/USD',
'stake_currency': 'USDT',
'hasQuoteVolume': True, 'hasQuoteVolume': True,
'timeframe': '5m', 'timeframe': '5m',
'futures_pair': 'BTC/USD:USD', 'futures_pair': 'BTC/USD:USD',
@ -44,11 +48,13 @@ EXCHANGES = {
}, },
'kucoin': { 'kucoin': {
'pair': 'BTC/USDT', 'pair': 'BTC/USDT',
'stake_currency': 'USDT',
'hasQuoteVolume': True, 'hasQuoteVolume': True,
'timeframe': '5m', 'timeframe': '5m',
}, },
'gateio': { 'gateio': {
'pair': 'BTC/USDT', 'pair': 'BTC/USDT',
'stake_currency': 'USDT',
'hasQuoteVolume': True, 'hasQuoteVolume': True,
'timeframe': '5m', 'timeframe': '5m',
'futures': True, 'futures': True,
@ -56,6 +62,7 @@ EXCHANGES = {
}, },
'okex': { 'okex': {
'pair': 'BTC/USDT', 'pair': 'BTC/USDT',
'stake_currency': 'USDT',
'hasQuoteVolume': True, 'hasQuoteVolume': True,
'timeframe': '5m', 'timeframe': '5m',
'futures_pair': 'BTC/USDT:USDT', 'futures_pair': 'BTC/USDT:USDT',
@ -83,8 +90,7 @@ def exchange_conf():
@pytest.fixture(params=EXCHANGES, scope="class") @pytest.fixture(params=EXCHANGES, scope="class")
def exchange(request, exchange_conf): def exchange(request, exchange_conf):
exchange_conf['exchange']['name'] = request.param exchange_conf['exchange']['name'] = request.param
exchange_conf['stake_currency'] = EXCHANGES[request.param].get( exchange_conf['stake_currency'] = EXCHANGES[request.param]['stake_currency']
'stake_currency', exchange_conf['stake_currency'])
exchange = ExchangeResolver.load_exchange(request.param, exchange_conf, validate=True) exchange = ExchangeResolver.load_exchange(request.param, exchange_conf, validate=True)
yield exchange, request.param yield exchange, request.param
@ -99,6 +105,8 @@ def exchange_futures(request, exchange_conf, class_mocker):
exchange_conf['exchange']['name'] = request.param exchange_conf['exchange']['name'] = request.param
exchange_conf['trading_mode'] = 'futures' exchange_conf['trading_mode'] = 'futures'
exchange_conf['collateral'] = 'cross' exchange_conf['collateral'] = 'cross'
exchange_conf['stake_currency'] = EXCHANGES[request.param]['stake_currency']
# TODO-lev: This mock should no longer be necessary once futures are enabled. # TODO-lev: This mock should no longer be necessary once futures are enabled.
class_mocker.patch( class_mocker.patch(
'freqtrade.exchange.exchange.Exchange.validate_trading_mode_and_collateral') 'freqtrade.exchange.exchange.Exchange.validate_trading_mode_and_collateral')