lint fixes and revert sum_support overwrite during merging

This commit is contained in:
Lex Berezhny 2020-11-17 15:20:25 -05:00
parent 85cf19bb2d
commit ec89baa831
3 changed files with 14 additions and 9 deletions

View file

@ -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]):

View file

@ -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)

View file

@ -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):