From 4cbde1b08fd32abdb3b47a0220fe3cf9245e141d Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Tue, 12 Mar 2019 09:58:19 -0400 Subject: [PATCH 1/2] use _batched_select to populate channel names when initializing files --- lbrynet/extras/daemon/storage.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lbrynet/extras/daemon/storage.py b/lbrynet/extras/daemon/storage.py index d3826530b..3ae395c3e 100644 --- a/lbrynet/extras/daemon/storage.py +++ b/lbrynet/extras/daemon/storage.py @@ -147,11 +147,11 @@ def get_all_lbry_files(transaction: sqlite3.Connection) -> typing.List[typing.Di "claim": claim } ) - for claim_id in signed_claims.keys(): - channel_name = transaction.execute("select claim_name from claim where claim_id=?", (claim_id, )).fetchone() - if channel_name: - for claim in signed_claims[claim_id]: - claim.channel_name = channel_name[0] + for claim_name, claim_id in _batched_select( + transaction, "select c.claim_name, c.claim_id from claim c where c.claim_id in {}", + list(signed_claims.keys())): + for claim in signed_claims[claim_id]: + claim.channel_name = claim_name return files From d0a1541d0a8e69948c552aa8c3ba08c9c8806a4d Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Tue, 12 Mar 2019 13:00:43 -0400 Subject: [PATCH 2/2] fix test --- tests/unit/wallet/test_account.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unit/wallet/test_account.py b/tests/unit/wallet/test_account.py index 92a8a7fb3..c0b9f99fd 100644 --- a/tests/unit/wallet/test_account.py +++ b/tests/unit/wallet/test_account.py @@ -73,6 +73,7 @@ class TestAccount(AsyncioTestCase): def test_load_and_save_account(self): account_data = { 'name': 'Main Account', + 'modified_on': 123.456, 'seed': "carbon smart garage balance margin twelve chest sword toast envelope bottom stomac" "h absent",