Update typehint for cancel_order

This commit is contained in:
Matthias 2020-04-18 06:55:25 +02:00
parent 0273539f06
commit c775d65126
2 changed files with 3 additions and 3 deletions

View File

@ -922,9 +922,9 @@ class Exchange:
return order.get('status') in ('closed', 'canceled') and order.get('filled') == 0.0
@retrier
def cancel_order(self, order_id: str, pair: str) -> None:
def cancel_order(self, order_id: str, pair: str) -> Dict:
if self._config['dry_run']:
return
return {}
try:
return self._api.cancel_order(order_id, pair)

View File

@ -1728,7 +1728,7 @@ def test_get_historic_trades_notsupported(default_conf, mocker, caplog, exchange
def test_cancel_order_dry_run(default_conf, mocker, exchange_name):
default_conf['dry_run'] = True
exchange = get_patched_exchange(mocker, default_conf, id=exchange_name)
assert exchange.cancel_order(order_id='123', pair='TKN/BTC') is None
assert exchange.cancel_order(order_id='123', pair='TKN/BTC') == {}
@pytest.mark.parametrize("exchange_name", EXCHANGES)