From c8c10d2bb029563ec9a5d334ad2afb8ef401b3d7 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Thu, 13 Feb 2020 14:58:51 -0500 Subject: [PATCH] fix claim apis failing with --resolve if no claims are present fixes https://github.com/lbryio/lbry-sdk/issues/2802 --- lbry/wallet/ledger.py | 3 ++- tests/integration/blockchain/test_claim_commands.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lbry/wallet/ledger.py b/lbry/wallet/ledger.py index 9812f81ac..16868c12b 100644 --- a/lbry/wallet/ledger.py +++ b/lbry/wallet/ledger.py @@ -630,7 +630,8 @@ class Ledger(metaclass=LedgerRegistry): raise asyncio.TimeoutError('Timed out waiting for transaction.') async def _inflate_outputs(self, query, accounts) -> Tuple[List[Output], dict, int, int]: - outputs = Outputs.from_base64(await query) + encoded_outputs = await query + outputs = Outputs.from_base64(encoded_outputs or b'') # TODO: why is the server returning None? txs = [] if len(outputs.txs) > 0: txs: List[Transaction] = await asyncio.gather(*( diff --git a/tests/integration/blockchain/test_claim_commands.py b/tests/integration/blockchain/test_claim_commands.py index a912c69f5..9c6afb2d7 100644 --- a/tests/integration/blockchain/test_claim_commands.py +++ b/tests/integration/blockchain/test_claim_commands.py @@ -403,6 +403,8 @@ class ClaimCommands(ClaimTestCase): self.assertEqual({'stream', 'channel'}, {c['value_type'] for c in r}) async def test_claim_stream_channel_list_with_resolve(self): + self.assertListEqual([], await self.claim_list(resolve=True)) + await self.channel_create() await self.stream_create()