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 asyncio
import logging 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 import Database, Result
from lbry.db.constants import TXO_TYPES from lbry.db.constants import TXO_TYPES
@ -152,8 +152,9 @@ class Service:
async def search_transactions(self, txids): async def search_transactions(self, txids):
raise NotImplementedError raise NotImplementedError
async def sum_supports(self, claim_hash: bytes, include_channel_content=False, exclude_own_supports=False) \ async def sum_supports(
-> Tuple[List[Dict], int]: self, claim_hash: bytes, include_channel_content=False, exclude_own_supports=False
) -> Tuple[List[Dict], int]:
raise NotImplementedError raise NotImplementedError
async def announce_addresses(self, address_manager, addresses: List[str]): async def announce_addresses(self, address_manager, addresses: List[str]):

View file

@ -1,5 +1,5 @@
import logging import logging
from typing import Optional, List, Dict from typing import Optional, List, Dict, Tuple
from binascii import hexlify, unhexlify from binascii import hexlify, unhexlify
from lbry.blockchain import Ledger, Transaction from lbry.blockchain import Ledger, Transaction
@ -79,5 +79,7 @@ class FullEndpoint(Service):
async def search_supports(self, accounts, **kwargs): async def search_supports(self, accounts, **kwargs):
pass pass
async def sum_supports(self, claim_hash: bytes, include_channel_content=False) -> List[Dict]: async def sum_supports(
return await self.db.sum_supports(claim_hash, include_channel_content) 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 asyncio
import logging import logging
from typing import Dict from typing import Dict
from typing import List, Optional, NamedTuple from typing import List, Optional, NamedTuple, Tuple
from binascii import unhexlify from binascii import unhexlify
from lbry.blockchain.block import Block, get_address_filter from lbry.blockchain.block import Block, get_address_filter
@ -62,8 +62,10 @@ class LightClient(Service):
async def search_supports(self, accounts, **kwargs): async def search_supports(self, accounts, **kwargs):
pass pass
async def sum_supports(self, claim_hash: bytes, include_channel_content=False) -> List[Dict]: async def sum_supports(
return await self.client.sum_supports(claim_hash, include_channel_content) 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): class TransactionEvent(NamedTuple):