Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/refactor wallet sync #1168

Merged
merged 5 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion test/functional/test_framework/wallet_cli_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,19 @@ async def _read_available_output(self) -> str:
try:
output = await asyncio.wait_for(self.process.stdout.read(ONE_MB), timeout=READ_TIMEOUT_SEC)
self.wallet_commands_file.write(output)
return output.decode().strip()
result = output.decode().strip()

try:
while True:
output = await asyncio.wait_for(self.process.stdout.read(ONE_MB), timeout=0.1)
if not output:
break
self.wallet_commands_file.write(output)
result += output.decode().strip()
except:
pass

return result
except:
self.wallet_commands_file.write(b"read from stdout timedout\n")
return ''
Expand Down
12 changes: 6 additions & 6 deletions test/functional/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ class UnicodeOnWindowsError(ValueError):
'p2p_relay_transactions.py',
'feature_db_reinit.py',
'feature_lmdb_backend_test.py',
# 'wallet_submit_tx.py',
# 'wallet_select_utxos.py',
# 'wallet_recover_accounts.py',
# 'wallet_get_address_usage.py',
# 'wallet_tokens.py',
# 'wallet_nfts.py',
'wallet_submit_tx.py',
'wallet_select_utxos.py',
'wallet_recover_accounts.py',
'wallet_get_address_usage.py',
'wallet_tokens.py',
'wallet_nfts.py',
'mempool_basic_reorg.py',
'mempool_eviction.py',
'mempool_ibd.py',
Expand Down
4 changes: 3 additions & 1 deletion test/functional/wallet_get_address_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ async def async_test(self):
+-------+----------------------------------------------+--------------------------------+
| 6 | rmt1q8lrw5tzgmwjnsc26v8qfu8k2jmddpmhwqz6kwt7 | No |
+-------+----------------------------------------------+--------------------------------+"""
assert expected_output == await wallet.get_addresses_usage()
output = await wallet.get_addresses_usage()
for (line, expected_line) in zip(output.split(), expected_output.split()):
assert line == expected_line


if __name__ == '__main__':
Expand Down
4 changes: 0 additions & 4 deletions test/functional/wallet_recover_accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,6 @@ async def async_test(self):
assert mnemonic is not None
assert "Successfully closed the wallet" in await wallet.close_wallet()
assert "New wallet created successfully" in await wallet.recover_wallet(mnemonic)
# check that balance is 0 and accounts are not present
assert "Coins amount: 0" in await wallet.get_balance()
for idx in range(num_accounts):
assert f"Account not found for index: {idx+1}" in await wallet.select_account(idx+1)

# sync and check that accounts are now present and with correct balances
assert "Success" in await wallet.sync()
Expand Down
Loading
Loading