mirror of
https://github.com/RoboSats/robosats.git
synced 2025-07-23 09:13:14 +00:00
Set cancel_status if it's not None
This commit is contained in:
@ -203,7 +203,7 @@ const TradeBox = ({ currentOrder, onStartAgain }: TradeBoxProps): JSX.Element =>
|
||||
mining_fee_rate,
|
||||
statement,
|
||||
rating,
|
||||
cancel_status
|
||||
cancel_status
|
||||
})
|
||||
.then((data: Order) => {
|
||||
setOpen(closeAll);
|
||||
|
@ -21,6 +21,7 @@ export interface SubmitActionProps {
|
||||
statement?: string;
|
||||
rating?: number;
|
||||
amount?: number;
|
||||
cancel_status?: number;
|
||||
}
|
||||
|
||||
export interface TradeRobotSummary {
|
||||
|
@ -1085,6 +1085,9 @@ class TradeTest(BaseAPITestCase):
|
||||
|
||||
trade.cancel_order(trade.maker_index)
|
||||
data = trade.response.json()
|
||||
self.assertEqual(
|
||||
data["bad_request"], "This order has been cancelled by the maker"
|
||||
)
|
||||
|
||||
trade.get_order(trade.taker_index)
|
||||
data = trade.response.json()
|
||||
@ -1092,6 +1095,12 @@ class TradeTest(BaseAPITestCase):
|
||||
data["bad_request"], "This order has been cancelled by the maker"
|
||||
)
|
||||
|
||||
trade.get_order(trade.third_index)
|
||||
data = trade.response.json()
|
||||
self.assertEqual(
|
||||
data["bad_request"], "This order has been cancelled by the maker"
|
||||
)
|
||||
|
||||
def test_cancel_order_cancel_status(self):
|
||||
"""
|
||||
Tests the cancellation of a public order using cancel_status.
|
||||
|
@ -118,7 +118,9 @@ class Trade:
|
||||
path = reverse("order")
|
||||
params = f"?order_id={self.order_id}"
|
||||
headers = self.get_robot_auth(robot_index)
|
||||
body = {"action": "cancel", "cancel_status": cancel_status}
|
||||
body = {"action": "cancel"}
|
||||
if cancel_status is not None:
|
||||
body.update({"cancel_status": cancel_status})
|
||||
self.response = self.client.post(path + params, body, **headers)
|
||||
|
||||
@patch("api.tasks.send_notification.delay", send_notification)
|
||||
|
Reference in New Issue
Block a user