Ensure no None status is passed from "create_order"

This commit is contained in:
Matthias
2023-09-20 20:01:51 +02:00
parent 8600ae0387
commit ddb0ae10b4
2 changed files with 4 additions and 0 deletions

View File

@@ -1079,6 +1079,9 @@ class Exchange:
rate_for_order,
params,
)
if order.get('status') is None:
# Map empty status to open.
order['status'] = 'open'
self._log_exchange_response('create_order', order)
order = self._order_contracts_to_amount(order)
return order

View File

@@ -1447,6 +1447,7 @@ def test_buy_considers_time_in_force(default_conf, mocker, exchange_name):
assert 'id' in order
assert 'info' in order
assert order['status'] == 'open'
assert order['id'] == order_id
assert api_mock.create_order.call_args[0][0] == 'ETH/BTC'
assert api_mock.create_order.call_args[0][1] == order_type