From f28e3bfe373141b689507269968134dd7bf941e1 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Wed, 1 Apr 2020 20:53:09 -0400 Subject: [PATCH] lint --- lbry/extras/daemon/daemon.py | 12 ++++++------ lbry/wallet/database.py | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lbry/extras/daemon/daemon.py b/lbry/extras/daemon/daemon.py index 1681ae6c1..77123daa7 100644 --- a/lbry/extras/daemon/daemon.py +++ b/lbry/extras/daemon/daemon.py @@ -4333,7 +4333,7 @@ class Daemon(metaclass=JSONRPCServerType): accounts = [wallet.get_account_or_error(account_id)] if account_id else wallet.accounts txos = await self.ledger.get_txos( wallet=wallet, accounts=accounts, read_only=True, - **self._constrain_txo_from_kwargs({}, unspent=True, is_my_output=True, **kwargs) + **self._constrain_txo_from_kwargs({}, is_spent=False, is_my_output=True, **kwargs) ) txs = [] while txos: @@ -4358,7 +4358,7 @@ class Daemon(metaclass=JSONRPCServerType): Usage: txo_list [--account_id=] [--type=...] [--txid=...] [--claim_id=...] [--name=...] - [--is_spent] [--is_not_spent] [--unspent] + [--is_spent] [--is_not_spent] [--is_my_input_or_output | [[--is_my_output | --is_not_my_output] [--is_my_input | --is_not_my_input]] ] @@ -4372,7 +4372,6 @@ class Daemon(metaclass=JSONRPCServerType): --name= : (str or list) claim name --is_spent : (bool) only show spent txos --is_not_spent : (bool) only show not spent txos - --unspent : (bool) deprecated, alias for --is_not_spent --is_my_input_or_output : (bool) txos which have your inputs or your outputs, if using this flag the other related flags are ignored (--is_my_output, --is_my_input, etc) @@ -4404,7 +4403,7 @@ class Daemon(metaclass=JSONRPCServerType): Usage: txo_plot [--account_id=] [--type=...] [--txid=...] - [--claim_id=...] [--name=...] [--unspent] + [--claim_id=...] [--name=...] [--is_spent] [--is_not_spent] [--is_my_input_or_output | [[--is_my_output | --is_not_my_output] [--is_my_input | --is_not_my_input]] ] @@ -4419,7 +4418,8 @@ class Daemon(metaclass=JSONRPCServerType): --txid= : (str or list) transaction id of outputs --claim_id= : (str or list) claim id --name= : (str or list) claim name - --unspent : (bool) hide spent outputs, show only unspent ones + --is_spent : (bool) only show spent txos + --is_not_spent : (bool) only show not spent txos --is_my_input_or_output : (bool) txos which have your inputs or your outputs, if using this flag the other related flags are ignored (--is_my_output, --is_my_input, etc) @@ -4476,7 +4476,7 @@ class Daemon(metaclass=JSONRPCServerType): Returns: {Paginated[Output]} """ kwargs['type'] = ['other', 'purchase'] - kwargs['unspent'] = True + kwargs['is_not_spent'] = True return self.jsonrpc_txo_list(*args, **kwargs) @requires(WALLET_COMPONENT) diff --git a/lbry/wallet/database.py b/lbry/wallet/database.py index 3c7cfe35c..d3590d015 100644 --- a/lbry/wallet/database.py +++ b/lbry/wallet/database.py @@ -864,7 +864,8 @@ class Database(SQLiteMixin): return txos - def _clean_txo_constraints_for_aggregation(self, constraints): + @staticmethod + def _clean_txo_constraints_for_aggregation(constraints): constraints.pop('include_is_spent', None) constraints.pop('include_is_my_input', None) constraints.pop('include_is_my_output', None)