refactor: Rename EventQueue table to Action

This commit is contained in:
tecnovert
2022-06-06 23:03:31 +02:00
parent d47a69c7cb
commit d909115ea4
8 changed files with 172 additions and 86 deletions

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2020-2021 tecnovert
# Copyright (c) 2020-2022 tecnovert
# Distributed under the MIT software license, see the accompanying
# file LICENSE.txt or http://www.opensource.org/licenses/mit-license.php.
@@ -140,6 +140,19 @@ def wait_for_bid_tx_state(delay_event, swap_client, bid_id, initiate_state, part
raise ValueError('wait_for_bid_tx_state timed out.')
def wait_for_event(delay_event, swap_client, linked_type, linked_id, wait_for=20):
logging.info('wait_for_event')
for i in range(wait_for):
if delay_event.is_set():
raise ValueError('Test stopped.')
delay_event.wait(1)
rv = swap_client.getEvents(linked_type, linked_id)
if len(rv) > 0:
return rv
raise ValueError('wait_for_event timed out.')
def wait_for_offer(delay_event, swap_client, offer_id, wait_for=20):
logging.info('wait_for_offer %s', offer_id.hex())
for i in range(wait_for):