Fix BNB fee bug when selling

thanks @epigramx, for reporting and for the detailed data.
This commit is contained in:
Matthias
2022-09-01 06:35:24 +02:00
parent 3d4ad1de4c
commit ba2eb7cf0f
2 changed files with 18 additions and 6 deletions

View File

@@ -4650,11 +4650,17 @@ def test_apply_fee_conditional(default_conf_usdt, fee, mocker,
fee_close=fee.return_value,
open_order_id="123456"
)
order = Order(
ft_order_side='buy',
order_id='100',
ft_pair=trade.pair,
ft_is_open=True,
)
freqtrade = get_patched_freqtradebot(mocker, default_conf_usdt)
walletmock.reset_mock()
# Amount is kept as is
assert freqtrade.apply_fee_conditional(trade, 'LTC', amount, fee_abs) == amount_exp
assert freqtrade.apply_fee_conditional(trade, 'LTC', amount, fee_abs, order) == amount_exp
assert walletmock.call_count == 1