Exchange.createOrder added * as second param

This commit is contained in:
Sam Germain 2022-02-03 18:28:08 -06:00
parent 16c2d54482
commit a50f4d2c57
2 changed files with 12 additions and 3 deletions

View File

@ -935,6 +935,7 @@ class Exchange:
def create_order( def create_order(
self, self,
*,
pair: str, pair: str,
ordertype: str, ordertype: str,
side: str, side: str,
@ -967,7 +968,7 @@ class Exchange:
side, side,
amount, amount,
rate_for_order, rate_for_order,
params params,
) )
self._log_exchange_response('create_order', order) self._log_exchange_response('create_order', order)
order = self._order_contracts_to_amount(order) order = self._order_contracts_to_amount(order)

View File

@ -1271,7 +1271,8 @@ def test_buy_prod(default_conf, mocker, exchange_name):
side="buy", side="buy",
amount=1, amount=1,
rate=200, rate=200,
time_in_force=time_in_force) time_in_force=time_in_force
)
assert api_mock.create_order.call_args[0][0] == 'ETH/BTC' assert api_mock.create_order.call_args[0][0] == 'ETH/BTC'
assert api_mock.create_order.call_args[0][1] == order_type assert api_mock.create_order.call_args[0][1] == order_type
assert api_mock.create_order.call_args[0][2] == 'buy' assert api_mock.create_order.call_args[0][2] == 'buy'
@ -2532,7 +2533,14 @@ def test_cancel_order_dry_run(default_conf, mocker, exchange_name):
assert exchange.cancel_order(order_id='123', pair='TKN/BTC') == {} assert exchange.cancel_order(order_id='123', pair='TKN/BTC') == {}
assert exchange.cancel_stoploss_order(order_id='123', pair='TKN/BTC') == {} assert exchange.cancel_stoploss_order(order_id='123', pair='TKN/BTC') == {}
order = exchange.create_order('ETH/BTC', 'limit', "buy", 5, 0.55, 'gtc') order = exchange.create_order(
pair='ETH/BTC',
ordertype='limit',
side='buy',
amount=5,
rate=0.55,
time_in_force='gtc',
)
cancel_order = exchange.cancel_order(order_id=order['id'], pair='ETH/BTC') cancel_order = exchange.cancel_order(order_id=order['id'], pair='ETH/BTC')
assert order['id'] == cancel_order['id'] assert order['id'] == cancel_order['id']