Fix more default arg usages
This commit is contained in:
@@ -239,7 +239,7 @@ class Bybit(Exchange):
|
|||||||
|
|
||||||
return orders
|
return orders
|
||||||
|
|
||||||
def fetch_order(self, order_id: str, pair: str, params: Dict = {}) -> Dict:
|
def fetch_order(self, order_id: str, pair: str, params: Optional[Dict] = None) -> Dict:
|
||||||
order = super().fetch_order(order_id, pair, params)
|
order = super().fetch_order(order_id, pair, params)
|
||||||
if (
|
if (
|
||||||
order.get('status') == 'canceled'
|
order.get('status') == 'canceled'
|
||||||
|
|||||||
@@ -1300,9 +1300,11 @@ class Exchange:
|
|||||||
raise OperationalException(e) from e
|
raise OperationalException(e) from e
|
||||||
|
|
||||||
@retrier(retries=API_FETCH_ORDER_RETRY_COUNT)
|
@retrier(retries=API_FETCH_ORDER_RETRY_COUNT)
|
||||||
def fetch_order(self, order_id: str, pair: str, params: Dict = {}) -> Dict:
|
def fetch_order(self, order_id: str, pair: str, params: Optional[Dict] = None) -> Dict:
|
||||||
if self._config['dry_run']:
|
if self._config['dry_run']:
|
||||||
return self.fetch_dry_run_order(order_id)
|
return self.fetch_dry_run_order(order_id)
|
||||||
|
if params is None:
|
||||||
|
params = {}
|
||||||
try:
|
try:
|
||||||
if not self.exchange_has('fetchOrder'):
|
if not self.exchange_has('fetchOrder'):
|
||||||
return self.fetch_order_emulated(order_id, pair, params)
|
return self.fetch_order_emulated(order_id, pair, params)
|
||||||
@@ -1324,7 +1326,7 @@ class Exchange:
|
|||||||
except ccxt.BaseError as e:
|
except ccxt.BaseError as e:
|
||||||
raise OperationalException(e) from e
|
raise OperationalException(e) from e
|
||||||
|
|
||||||
def fetch_stoploss_order(self, order_id: str, pair: str, params: Dict = {}) -> Dict:
|
def fetch_stoploss_order(self, order_id: str, pair: str, params: Optional[Dict] = None) -> Dict:
|
||||||
return self.fetch_order(order_id, pair, params)
|
return self.fetch_order(order_id, pair, params)
|
||||||
|
|
||||||
def fetch_order_or_stoploss_order(self, order_id: str, pair: str,
|
def fetch_order_or_stoploss_order(self, order_id: str, pair: str,
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ class Gate(Exchange):
|
|||||||
def get_order_id_conditional(self, order: Dict[str, Any]) -> str:
|
def get_order_id_conditional(self, order: Dict[str, Any]) -> str:
|
||||||
return safe_value_fallback2(order, order, 'id_stop', 'id')
|
return safe_value_fallback2(order, order, 'id_stop', 'id')
|
||||||
|
|
||||||
def fetch_stoploss_order(self, order_id: str, pair: str, params: Dict = {}) -> Dict:
|
def fetch_stoploss_order(self, order_id: str, pair: str, params: Optional[Dict] = None) -> Dict:
|
||||||
order = self.fetch_order(
|
order = self.fetch_order(
|
||||||
order_id=order_id,
|
order_id=order_id,
|
||||||
pair=pair,
|
pair=pair,
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ class Okx(Exchange):
|
|||||||
order['type'] = 'stoploss'
|
order['type'] = 'stoploss'
|
||||||
return order
|
return order
|
||||||
|
|
||||||
def fetch_stoploss_order(self, order_id: str, pair: str, params: Dict = {}) -> Dict:
|
def fetch_stoploss_order(self, order_id: str, pair: str, params: Optional[Dict] = None) -> Dict:
|
||||||
if self._config['dry_run']:
|
if self._config['dry_run']:
|
||||||
return self.fetch_dry_run_order(order_id)
|
return self.fetch_dry_run_order(order_id)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user