Skip to content

Commit

Permalink
qa: fix flaky test of unconfirmed spend RBF
Browse files Browse the repository at this point in the history
  • Loading branch information
darosior committed Nov 20, 2023
1 parent 38b851e commit 6b5fc2d
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions tests/test_chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,11 +397,15 @@ def test_conflicting_unconfirmed_spend_txs(lianad, bitcoind):
bitcoind.rpc.sendrawtransaction(tx_hex)

# We must now detect the coin as being spent by the second transaction.
wait_for(
lambda: get_coin(lianad, spent_coin["outpoint"])["spend_info"] is not None
and get_coin(lianad, spent_coin["outpoint"])["spend_info"]["txid"]
== txid_b.hex()
)
def is_spent_by(lianad, outpoint, txid):
coins = lianad.rpc.listcoins([], [outpoint])["coins"]
if len(coins) == 0:
return False
coin = coins[0]
if coin["spend_info"] is None:
return False
return coin["spend_info"]["txid"] == txid.hex()
wait_for(lambda: is_spent_by(lianad, spent_coin["outpoint"], txid_b))


def sign_and_broadcast_psbt(lianad, psbt):
Expand Down

0 comments on commit 6b5fc2d

Please sign in to comment.