pytest: Fix a test assuming a specific DB order

Postgresql does not guarantee insertion order when querying, so we need to
actually go and look for the correct transaction.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
Christian Decker 2019-11-19 15:26:09 +01:00 committed by Rusty Russell
parent 1e89937a0a
commit 3482d254e3
1 changed files with 3 additions and 2 deletions

View File

@ -676,5 +676,6 @@ def test_fundchannel_listtransaction(node_factory, bitcoind):
# next call warned about SQL Accessing a null column
# and crashed the daemon for accessing random memory or null
txs = l1.rpc.listtransactions()['transactions']
assert txs[0]['hash'] == txid
assert txs[0]['blockheight'] == 0
tx = [t for t in txs if t['hash'] == txid][0]
assert tx['blockheight'] == 0