From 9198877098b6789ff3d54c8f9d871405a91486b6 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Sun, 21 Jun 2020 19:52:39 -0400 Subject: [PATCH] include_is_spent no longer needed --- lbry/db/queries.py | 4 ---- lbry/service/api.py | 1 - lbry/testcase.py | 2 +- lbry/wallet/wallet.py | 3 +-- 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/lbry/db/queries.py b/lbry/db/queries.py index e8a29b42e..07f5fa12a 100644 --- a/lbry/db/queries.py +++ b/lbry/db/queries.py @@ -217,7 +217,6 @@ def get_transactions(**constraints) -> Tuple[List[Transaction], Optional[int]]: def _get_transactions(wallet=None, include_total=False, **constraints) -> Tuple[List[Transaction], Optional[int]]: - include_is_spent = constraints.pop('include_is_spent', False) include_is_my_input = constraints.pop('include_is_my_input', False) include_is_my_output = constraints.pop('include_is_my_output', False) @@ -244,7 +243,6 @@ def _get_transactions(wallet=None, include_total=False, **constraints) -> Tuple[ get_txos( wallet=wallet, tx_hash__in=txids[offset:offset + MAX_QUERY_VARIABLES], order_by='txo.tx_hash', - include_is_spent=include_is_spent, include_is_my_input=include_is_my_input, include_is_my_output=include_is_my_output, )[0] @@ -403,7 +401,6 @@ def rows_to_txos(rows: List[dict], include_tx=True) -> List[Output]: def get_txos(no_tx=False, include_total=False, **constraints) -> Tuple[List[Output], Optional[int]]: wallet_account_ids = constraints.pop('wallet_account_ids', []) - include_is_spent = constraints.get('include_is_spent', False) include_is_my_input = constraints.get('include_is_my_input', False) include_is_my_output = constraints.pop('include_is_my_output', False) include_received_tips = constraints.pop('include_received_tips', False) @@ -475,7 +472,6 @@ def get_txos(no_tx=False, include_total=False, **constraints) -> Tuple[List[Outp 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) constraints.pop('include_received_tips', None) diff --git a/lbry/service/api.py b/lbry/service/api.py index a2daecb69..c94ef6497 100644 --- a/lbry/service/api.py +++ b/lbry/service/api.py @@ -2701,7 +2701,6 @@ class API: accounts = wallet.accounts.get_or_all(txo_dict.pop('account_id')) constraints = { 'resolve': resolve, - 'include_is_spent': True, 'include_is_my_input': True, 'include_is_my_output': True, 'include_received_tips': include_received_tips, diff --git a/lbry/testcase.py b/lbry/testcase.py index ce53403b5..68a9e4af2 100644 --- a/lbry/testcase.py +++ b/lbry/testcase.py @@ -387,7 +387,7 @@ class UnitDBTestCase(AsyncioTestCase): async def get_claims(self): claims = [] sql = ( - "select claim_id from claim order by height, tx_position" + "select claim_id from claim order by height" ) for claim in await self.db.execute_fetchall(sql): claims.append(claim['claim_id']) diff --git a/lbry/wallet/wallet.py b/lbry/wallet/wallet.py index c073c8280..85296bf26 100644 --- a/lbry/wallet/wallet.py +++ b/lbry/wallet/wallet.py @@ -261,8 +261,7 @@ class Wallet: async def list_transactions(self, **constraints): return txs_to_dict(await self.db.get_transactions( - include_is_my_output=True, include_is_spent=True, - **constraints + include_is_my_output=True, **constraints ), self.ledger) async def create_transaction(