diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index f2297833e..bd4e8b9b8 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -106,7 +106,7 @@ class FreqtradeBot(LoggingMixin): LoggingMixin.__init__(self, logger, timeframe_to_seconds(self.strategy.timeframe)) if 'trading_mode' in self.config: - self.trading_mode = self.config['trading_mode'] + self.trading_mode = TradingMode(self.config['trading_mode']) else: self.trading_mode = TradingMode.SPOT diff --git a/tests/exchange/test_exchange.py b/tests/exchange/test_exchange.py index 95a91f7cc..0f8c35e1b 100644 --- a/tests/exchange/test_exchange.py +++ b/tests/exchange/test_exchange.py @@ -3053,36 +3053,36 @@ def test_get_funding_fees_from_exchange(default_conf, mocker, exchange_name): api_mock = MagicMock() api_mock.fetch_funding_history = MagicMock(return_value=[ { - 'amount': 0.14542341, + 'amount': 0.14542, 'code': 'USDT', 'datetime': '2021-09-01T08:00:01.000Z', 'id': '485478', 'info': {'asset': 'USDT', - 'income': '0.14542341', + 'income': '0.14542', 'incomeType': 'FUNDING_FEE', 'info': 'FUNDING_FEE', 'symbol': 'XRPUSDT', - 'time': '1630512001000', + 'time': '1630382001000', 'tradeId': '', - 'tranId': '4854789484855218760'}, + 'tranId': '993203'}, 'symbol': 'XRP/USDT', - 'timestamp': 1630512001000 + 'timestamp': 1630382001000 }, { - 'amount': -0.14642341, + 'amount': -0.14642, 'code': 'USDT', 'datetime': '2021-09-01T16:00:01.000Z', 'id': '485479', 'info': {'asset': 'USDT', - 'income': '-0.14642341', + 'income': '-0.14642', 'incomeType': 'FUNDING_FEE', 'info': 'FUNDING_FEE', 'symbol': 'XRPUSDT', - 'time': '1630512001000', + 'time': '1630314001000', 'tradeId': '', - 'tranId': '4854789484855218760'}, + 'tranId': '993204'}, 'symbol': 'XRP/USDT', - 'timestamp': 1630512001000 + 'timestamp': 1630314001000 } ]) type(api_mock).has = PropertyMock(return_value={'fetchFundingHistory': True})