wait for tx instead

This commit is contained in:
Victor Shyba 2020-01-08 13:09:16 -03:00
parent 15a2f048ac
commit 200531dd96
2 changed files with 6 additions and 3 deletions

View file

@ -253,6 +253,11 @@ class IntegrationTestCase(AsyncioTestCase):
lambda e: e.tx.id == txid
)
def on_address_update(self, address):
return self.ledger.on_transaction.where(
lambda e: e.address == address
)
def on_transaction_address(self, tx, address):
return self.ledger.on_transaction.where(
lambda e: e.tx.id == tx.id and e.address == address

View file

@ -77,10 +77,8 @@ class TestUsagePayment(CommandTestCase):
self.assertEqual(features["payment_address"], address)
self.assertEqual(features["daily_fee"], "1.1")
await asyncio.sleep(1) # fixme: wait on something better
await self.on_address_update(address)
_, history = await self.ledger.get_local_status_and_history(address)
self.assertNotEqual(history, [])
txid, nout = history[0]
tx_details = await self.daemon.jsonrpc_transaction_show(txid)
self.assertEqual(tx_details.outputs[nout].amount, 110000000)