self.mark_finished_order()
def mark_dust_amount_remaining_order(self):
- if self.market.ccxt.is_dust_trade(self.remaining_amount().value, self.rate):
+ if self.status == "open" and self.market.ccxt.is_dust_trade(self.remaining_amount().value, self.rate):
self.status = "closed_dust_remaining"
def remaining_amount(self, refetch=False):
self.m.ccxt.is_dust_trade.return_value = True
order.mark_dust_amount_remaining_order()
+ self.assertEqual("pending", order.status)
+
+ order.status = "open"
+ order.mark_dust_amount_remaining_order()
self.assertEqual("closed_dust_remaining", order.status)
@mock.patch.object(portfolio.Order, "fetch")