From 9a6326b027060cae8cfe5b5ab029bb5b5a4ffb40 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Wed, 22 Apr 2020 10:36:09 -0400 Subject: [PATCH] fix for claim_list incorrectly handling --is_spent flag --- lbry/extras/daemon/daemon.py | 2 +- tests/integration/blockchain/test_claim_commands.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lbry/extras/daemon/daemon.py b/lbry/extras/daemon/daemon.py index 9789bfa14..6e2ef7aa9 100644 --- a/lbry/extras/daemon/daemon.py +++ b/lbry/extras/daemon/daemon.py @@ -2237,7 +2237,7 @@ class Daemon(metaclass=JSONRPCServerType): Returns: {Paginated[Output]} """ kwargs['type'] = claim_type or CLAIM_TYPE_NAMES - if 'is_spent' not in kwargs: + if not kwargs.get('is_spent', False): kwargs['is_not_spent'] = True return self.jsonrpc_txo_list(**kwargs) diff --git a/tests/integration/blockchain/test_claim_commands.py b/tests/integration/blockchain/test_claim_commands.py index eda369674..4873e0cde 100644 --- a/tests/integration/blockchain/test_claim_commands.py +++ b/tests/integration/blockchain/test_claim_commands.py @@ -661,12 +661,15 @@ class ClaimCommands(ClaimTestCase): channel_id = self.get_claim_id(await self.channel_create()) stream_id = self.get_claim_id(await self.stream_create()) + await self.stream_update(stream_id, title='foo') + # type filtering r = await self.claim_list(claim_type='channel') self.assertEqual(1, len(r)) self.assertEqual('channel', r[0]['value_type']) - r = await self.claim_list(claim_type='stream') + # catch a bug where cli sends is_spent=False by default + r = await self.claim_list(claim_type='stream', is_spent=False) self.assertEqual(1, len(r)) self.assertEqual('stream', r[0]['value_type'])