From ec89baa831692975a959fb86beed7672757bae11 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Tue, 17 Nov 2020 15:20:25 -0500 Subject: [PATCH] lint fixes and revert sum_support overwrite during merging --- lbry/service/base.py | 7 ++++--- lbry/service/full_endpoint.py | 8 +++++--- lbry/service/light_client.py | 8 +++++--- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/lbry/service/base.py b/lbry/service/base.py index a64704415..3a5bd5da5 100644 --- a/lbry/service/base.py +++ b/lbry/service/base.py @@ -1,6 +1,6 @@ import asyncio import logging -from typing import List, Optional, NamedTuple, Dict +from typing import List, Optional, NamedTuple, Dict, Tuple from lbry.db import Database, Result from lbry.db.constants import TXO_TYPES @@ -152,8 +152,9 @@ class Service: async def search_transactions(self, txids): raise NotImplementedError - async def sum_supports(self, claim_hash: bytes, include_channel_content=False, exclude_own_supports=False) \ - -> Tuple[List[Dict], int]: + async def sum_supports( + self, claim_hash: bytes, include_channel_content=False, exclude_own_supports=False + ) -> Tuple[List[Dict], int]: raise NotImplementedError async def announce_addresses(self, address_manager, addresses: List[str]): diff --git a/lbry/service/full_endpoint.py b/lbry/service/full_endpoint.py index 44ffded7e..beae431f3 100644 --- a/lbry/service/full_endpoint.py +++ b/lbry/service/full_endpoint.py @@ -1,5 +1,5 @@ import logging -from typing import Optional, List, Dict +from typing import Optional, List, Dict, Tuple from binascii import hexlify, unhexlify from lbry.blockchain import Ledger, Transaction @@ -79,5 +79,7 @@ class FullEndpoint(Service): async def search_supports(self, accounts, **kwargs): pass - async def sum_supports(self, claim_hash: bytes, include_channel_content=False) -> List[Dict]: - return await self.db.sum_supports(claim_hash, include_channel_content) + async def sum_supports( + self, claim_hash: bytes, include_channel_content=False, exclude_own_supports=False + ) -> Tuple[List[Dict], int]: + return await self.db.sum_supports(claim_hash, include_channel_content, exclude_own_supports) diff --git a/lbry/service/light_client.py b/lbry/service/light_client.py index 7c6936d27..c209141bc 100644 --- a/lbry/service/light_client.py +++ b/lbry/service/light_client.py @@ -1,7 +1,7 @@ import asyncio import logging from typing import Dict -from typing import List, Optional, NamedTuple +from typing import List, Optional, NamedTuple, Tuple from binascii import unhexlify from lbry.blockchain.block import Block, get_address_filter @@ -62,8 +62,10 @@ class LightClient(Service): async def search_supports(self, accounts, **kwargs): pass - async def sum_supports(self, claim_hash: bytes, include_channel_content=False) -> List[Dict]: - return await self.client.sum_supports(claim_hash, include_channel_content) + async def sum_supports( + self, claim_hash: bytes, include_channel_content=False, exclude_own_supports=False + ) -> Tuple[List[Dict], int]: + return await self.client.sum_supports(claim_hash, include_channel_content, exclude_own_supports) class TransactionEvent(NamedTuple):