update aiohttp and pylint
This commit is contained in:
parent
591e66bfbb
commit
d95903d219
6 changed files with 15 additions and 18 deletions
|
@ -9,7 +9,7 @@ jobs:
|
|||
- stage: code quality
|
||||
name: "pylint lbrynet"
|
||||
install:
|
||||
- pip install astroid==2.0.4 pylint
|
||||
- pip install astroid pylint
|
||||
- pip install git+https://github.com/lbryio/torba.git#egg=torba
|
||||
- pip install -e .
|
||||
script: pylint lbrynet
|
||||
|
|
|
@ -67,8 +67,7 @@ class RequestDatagram(KademliaDatagramBase):
|
|||
def make_ping(cls, from_node_id: bytes, rpc_id: typing.Optional[bytes] = None) -> 'RequestDatagram':
|
||||
if rpc_id and len(rpc_id) != constants.rpc_id_length:
|
||||
raise ValueError("invalid rpc id length")
|
||||
elif not rpc_id:
|
||||
rpc_id = constants.generate_id()[:constants.rpc_id_length]
|
||||
rpc_id = rpc_id or constants.generate_id()[:constants.rpc_id_length]
|
||||
if len(from_node_id) != constants.hash_bits // 8:
|
||||
raise ValueError("invalid node id")
|
||||
return cls(REQUEST_TYPE, rpc_id, from_node_id, b'ping')
|
||||
|
|
|
@ -843,12 +843,12 @@ class Daemon(metaclass=JSONRPCServerType):
|
|||
amount = self.get_dewies_or_error("amount", amount)
|
||||
if not amount:
|
||||
raise NullFundsError
|
||||
elif amount < 0:
|
||||
if amount < 0:
|
||||
raise NegativeFundsError()
|
||||
|
||||
if address and claim_id:
|
||||
raise Exception("Given both an address and a claim id")
|
||||
elif not address and not claim_id:
|
||||
if not address and not claim_id:
|
||||
raise Exception("Not given an address or a claim id")
|
||||
|
||||
if address:
|
||||
|
@ -1238,7 +1238,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
|||
amount = self.get_dewies_or_error("amount", amount)
|
||||
if not amount:
|
||||
raise NullFundsError
|
||||
elif amount < 0:
|
||||
if amount < 0:
|
||||
raise NegativeFundsError()
|
||||
|
||||
for address in addresses:
|
||||
|
|
|
@ -445,11 +445,11 @@ def _handle_claim_result(results):
|
|||
if results['error'] in ['name is not claimed', 'claim not found']:
|
||||
if 'claim_id' in results:
|
||||
raise UnknownClaimID(results['claim_id'])
|
||||
elif 'name' in results:
|
||||
if 'name' in results:
|
||||
raise UnknownNameError(results['name'])
|
||||
elif 'uri' in results:
|
||||
if 'uri' in results:
|
||||
raise UnknownURI(results['uri'])
|
||||
elif 'outpoint' in results:
|
||||
if 'outpoint' in results:
|
||||
raise UnknownOutpoint(results['outpoint'])
|
||||
raise Exception(results['error'])
|
||||
|
||||
|
|
|
@ -434,12 +434,11 @@ class StreamManager:
|
|||
msg = f"fee of {fee_amount} exceeds max configured to allow of {max_fee_amount}"
|
||||
log.warning(msg)
|
||||
raise KeyFeeAboveMaxAllowed(msg)
|
||||
else:
|
||||
balance = await self.wallet.default_account.get_balance()
|
||||
if lbc_to_dewies(str(fee_amount)) > balance:
|
||||
msg = f"fee of {fee_amount} exceeds max available balance"
|
||||
log.warning(msg)
|
||||
raise InsufficientFundsError(msg)
|
||||
balance = await self.wallet.default_account.get_balance()
|
||||
if lbc_to_dewies(str(fee_amount)) > balance:
|
||||
msg = f"fee of {fee_amount} exceeds max available balance"
|
||||
log.warning(msg)
|
||||
raise InsufficientFundsError(msg)
|
||||
fee_address = claim.source_fee.address.decode()
|
||||
outpoint = f"{resolved['txid']}:{resolved['nout']}"
|
||||
existing = self.get_filtered_streams(outpoint=outpoint)
|
||||
|
@ -449,8 +448,7 @@ class StreamManager:
|
|||
if existing and existing[0].claim_id != resolved['claim_id']:
|
||||
raise Exception(f"stream for {existing[0].claim_id} collides with existing "
|
||||
f"download {resolved['claim_id']}")
|
||||
elif not existing:
|
||||
existing.extend(self.get_filtered_streams(claim_id=resolved['claim_id']))
|
||||
existing.extend(self.get_filtered_streams(claim_id=resolved['claim_id']))
|
||||
if existing and existing[0].sd_hash != claim.source_hash.decode():
|
||||
log.info("claim contains an update to a stream we have, downloading it")
|
||||
stream = await self.download_stream_from_claim(
|
||||
|
|
2
setup.py
2
setup.py
|
@ -23,7 +23,7 @@ setup(
|
|||
'console_scripts': 'lbrynet=lbrynet.extras.cli:main'
|
||||
},
|
||||
install_requires=[
|
||||
'aiohttp==3.4.4',
|
||||
'aiohttp==3.5.4',
|
||||
'aioupnp',
|
||||
'appdirs==1.4.3',
|
||||
'colorama==0.3.7',
|
||||
|
|
Loading…
Reference in a new issue