improve tests, fix types

This commit is contained in:
Victor Shyba 2020-01-10 12:32:32 -03:00
parent 200531dd96
commit 5a6218eeca
2 changed files with 4 additions and 4 deletions

View file

@ -34,7 +34,7 @@ class WalletManager:
self.ledgers = ledgers or {} self.ledgers = ledgers or {}
self.running = False self.running = False
self.config: Optional[Config] = None self.config: Optional[Config] = None
self.usage_payment_service: Optional[WalletManager] = None self.usage_payment_service: Optional[WalletServerPayer] = None
@classmethod @classmethod
def from_config(cls, config: dict) -> 'WalletManager': def from_config(cls, config: dict) -> 'WalletManager':

View file

@ -54,7 +54,6 @@ class TestSegwitServer(IntegrationTestCase):
class TestUsagePayment(CommandTestCase): class TestUsagePayment(CommandTestCase):
VERBOSITY = 'DEBUG'
LEDGER = lbry.wallet LEDGER = lbry.wallet
def setUp(self) -> None: def setUp(self) -> None:
@ -77,8 +76,9 @@ 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 self.on_address_update(address) if len(history) == 0:
_, history = await self.ledger.get_local_status_and_history(address) await self.on_address_update(address)
_, history = await self.ledger.get_local_status_and_history(address)
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)