From 1086a3297f1173c1e0d2ac215e466c8f41d880d8 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Fri, 21 Feb 2020 17:25:12 -0300 Subject: [PATCH] check its broadcasted and use a retriable call --- lbry/wallet/usage_payment.py | 2 +- tests/integration/blockchain/test_wallet_server_sessions.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lbry/wallet/usage_payment.py b/lbry/wallet/usage_payment.py index 9e7c6857b..67c740260 100644 --- a/lbry/wallet/usage_payment.py +++ b/lbry/wallet/usage_payment.py @@ -29,7 +29,7 @@ class WalletServerPayer: async def pay(self): while self.running: await asyncio.sleep(self.payment_period) - features = await self.ledger.network.get_server_features() + features = await self.ledger.network.retriable_call(self.ledger.network.get_server_features) address = features['payment_address'] amount = str(features['daily_fee']) if not address or not amount: diff --git a/tests/integration/blockchain/test_wallet_server_sessions.py b/tests/integration/blockchain/test_wallet_server_sessions.py index 3b394f547..1cf857972 100644 --- a/tests/integration/blockchain/test_wallet_server_sessions.py +++ b/tests/integration/blockchain/test_wallet_server_sessions.py @@ -67,7 +67,7 @@ class TestUsagePayment(CommandTestCase): await wallet_pay_service.stop() await wallet_pay_service.start(ledger=self.ledger, wallet=self.wallet) - address = (await self.account.receiving.get_addresses(limit=1, only_usable=True))[0] + address = await self.blockchain.get_raw_change_address() _, history = await self.ledger.get_local_status_and_history(address) self.assertEqual(history, []) @@ -91,5 +91,6 @@ class TestUsagePayment(CommandTestCase): self.assertEqual(features["payment_address"], address) self.assertEqual(features["daily_fee"], "1.0") tx = await asyncio.wait_for(wallet_pay_service.on_payment.first, timeout=3) + self.assertIsNotNone(await self.blockchain.get_raw_transaction(tx.id)) # verify its broadcasted self.assertEqual(tx.outputs[0].amount, 100000000) self.assertEqual(tx.outputs[0].get_address(self.ledger), address)