api: Add ability to abandon bids.
This commit is contained in:
parent
ac16fc07a4
commit
3234e3fba3
@ -318,6 +318,8 @@ def js_bids(self, url_split, post_string: str, is_json: bool) -> bytes:
|
||||
post_data = getFormData(post_string, is_json)
|
||||
if have_data_entry(post_data, 'accept'):
|
||||
swap_client.acceptBid(bid_id)
|
||||
elif have_data_entry(post_data, 'abandon'):
|
||||
swap_client.abandonBid(bid_id)
|
||||
elif have_data_entry(post_data, 'debugind'):
|
||||
swap_client.setBidDebugInd(bid_id, int(get_data_entry(post_data, 'debugind')))
|
||||
|
||||
|
@ -283,7 +283,7 @@ class Test(BaseTest):
|
||||
bid_id = swap_clients[1].postBid(offer_id, offer.amount_from)
|
||||
|
||||
wait_for_bid(test_delay_event, swap_clients[0], bid_id)
|
||||
swap_clients[1].abandonBid(bid_id)
|
||||
read_json_api(1801, 'bids/{}'.format(bid_id.hex()), {'abandon': True})
|
||||
swap_clients[0].acceptBid(bid_id)
|
||||
|
||||
wait_for_bid(test_delay_event, swap_clients[0], bid_id, BidStates.SWAP_COMPLETED, wait_for=60)
|
||||
|
Loading…
Reference in New Issue
Block a user