on_ready.wait so we start after tx syncs

This commit is contained in:
Victor Shyba 2020-03-23 12:26:07 -03:00
parent 0bd65356f9
commit a08cbf412d
5 changed files with 1 additions and 4 deletions

View file

@ -370,7 +370,6 @@ class CommandTestCase(IntegrationTestCase):
)
self.extra_wallet_node_port += 1
await wallet_node.start(self.conductor.spv_node, seed=seed)
await wallet_node.ledger.on_ready.first
self.extra_wallet_nodes.append(wallet_node)
upload_dir = os.path.join(wallet_node.data_path, 'uploads')

View file

@ -323,6 +323,7 @@ class Ledger(metaclass=LedgerRegistry):
else:
await self._report_state()
self.on_transaction.listen(self._reset_balance_cache)
await self.on_ready.first
async def join_network(self, *_):
log.info("Subscribing and updating accounts.")

View file

@ -77,7 +77,6 @@ class Conductor:
async def start_wallet(self):
if not self.wallet_started:
await self.wallet_node.start(self.spv_node)
await self.wallet_node.ledger.on_ready.first
self.wallet_started = True
async def stop_wallet(self):

View file

@ -87,7 +87,6 @@ class ResolveCommand(BaseResolveTestCase):
await self.conductor.spv_node.stop()
resolve_task = asyncio.create_task(self.resolve('foo'))
await self.conductor.spv_node.start(self.conductor.blockchain_node)
await self.ledger.on_ready.first
self.assertIsNotNone((await resolve_task)['claim_id'])
async def test_winning_by_effective_amount(self):

View file

@ -27,7 +27,6 @@ class SyncTests(IntegrationTestCase):
wallet_node = WalletNode(WalletManager, RegTestLedger, port=self.api_port)
await wallet_node.start(self.conductor.spv_node, seed)
self.started_nodes.append(wallet_node)
await wallet_node.ledger.on_ready.first
return wallet_node
async def test_nodes_with_same_account_stay_in_sync(self):