forked from LBRYCommunity/lbry-sdk
wait for tx instead
This commit is contained in:
parent
15a2f048ac
commit
200531dd96
2 changed files with 6 additions and 3 deletions
|
@ -253,6 +253,11 @@ class IntegrationTestCase(AsyncioTestCase):
|
||||||
lambda e: e.tx.id == txid
|
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):
|
def on_transaction_address(self, tx, address):
|
||||||
return self.ledger.on_transaction.where(
|
return self.ledger.on_transaction.where(
|
||||||
lambda e: e.tx.id == tx.id and e.address == address
|
lambda e: e.tx.id == tx.id and e.address == address
|
||||||
|
|
|
@ -77,10 +77,8 @@ class TestUsagePayment(CommandTestCase):
|
||||||
self.assertEqual(features["payment_address"], address)
|
self.assertEqual(features["payment_address"], address)
|
||||||
self.assertEqual(features["daily_fee"], "1.1")
|
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)
|
_, history = await self.ledger.get_local_status_and_history(address)
|
||||||
self.assertNotEqual(history, [])
|
|
||||||
txid, nout = history[0]
|
txid, nout = history[0]
|
||||||
tx_details = await self.daemon.jsonrpc_transaction_show(txid)
|
tx_details = await self.daemon.jsonrpc_transaction_show(txid)
|
||||||
self.assertEqual(tx_details.outputs[nout].amount, 110000000)
|
self.assertEqual(tx_details.outputs[nout].amount, 110000000)
|
||||||
|
|
Loading…
Reference in a new issue