From 7f88f9bf27dacba038a382b54b009bbec6292b3e Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 2 Jan 2022 13:11:29 +0100 Subject: [PATCH] Revert unintended double-call of amount conversion --- freqtrade/exchange/exchange.py | 10 +++------- tests/exchange/test_exchange.py | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index 5cadc242e..1141b0fa6 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -1288,13 +1288,9 @@ class Exchange: # since needs to be int in milliseconds _params = params if params else {} my_trades = self._api.fetch_my_trades( - pair, - int((since.replace(tzinfo=timezone.utc).timestamp() - 5) * 1000), - params=_params - ) - matched_trades = self._trades_contracts_to_amount( - trades=[trade for trade in my_trades if trade['order'] == order_id] - ) + pair, int((since.replace(tzinfo=timezone.utc).timestamp() - 5) * 1000), + params=_params) + matched_trades = [trade for trade in my_trades if trade['order'] == order_id] self._log_exchange_response('get_trades_for_order', matched_trades) diff --git a/tests/exchange/test_exchange.py b/tests/exchange/test_exchange.py index 79de1e1b2..7edc3c755 100644 --- a/tests/exchange/test_exchange.py +++ b/tests/exchange/test_exchange.py @@ -2797,7 +2797,7 @@ def test_name(default_conf, mocker, exchange_name): @pytest.mark.parametrize("trading_mode,amount", [ ('spot', 0.2340606), - ('futures', 23.40606), + ('futures', 2.340606), ]) @pytest.mark.parametrize("exchange_name", EXCHANGES) def test_get_trades_for_order(default_conf, mocker, exchange_name, trading_mode, amount):