Skip to content

Commit

Permalink
fix flake8 complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
myrho committed Dec 22, 2023
1 parent 986be1d commit 01900a7
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
21 changes: 16 additions & 5 deletions gsrest/db/cassandra.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,17 @@
from math import floor, ceil

from gsrest.util.eth_logs import decode_db_logs
from gsrest.errors import *
from gsrest.errors import (NetworkNotFoundException,
BadUserInputException,
BadConfigError,
NotFoundException,
BlockNotFoundException,
AddressNotFoundException,
ClusterNotFoundException,
DBInconsistencyException,
nodeNotFoundException,
TransactionNotFoundException)

from gsrest.util import is_eth_like
from gsrest.util.address import (address_to_user_format)
from gsrest.util.evm import (bytes_to_hex, strip_0x, hex_str_to_bytes)
Expand Down Expand Up @@ -480,7 +490,7 @@ def execute_async_lowlevel(self,

h = hash(q + str(params))

#self.logger.debug(f'{h} {q} {params}')
# self.logger.debug(f'{h} {q} {params}')

def on_done(result):
if future.cancelled():
Expand Down Expand Up @@ -2148,7 +2158,8 @@ async def get_tx_by_id_eth(self, currency, id):
if not result:
return None
try:
return await self.get_tx_by_hash_eth(currency, result['transaction'])
return \
await self.get_tx_by_hash_eth(currency, result['transaction'])
except TransactionNotFoundException:
raise DBInconsistencyException(
f"transaction {bytes_to_hex(result['transaction'])} "
Expand Down Expand Up @@ -2233,7 +2244,7 @@ async def list_links_eth(self,
node_type = NodeType.ADDRESS
address_id = address
address_id_group = self.get_id_group(currency, address_id)
address = (await self.get_address_by_address_id(currency, address_id))
address = await self.get_address_by_address_id(currency, address_id)
neighbor_id = neighbor
neighbor_id_group = self.get_id_group(currency, neighbor_id)
neighbor = (await
Expand Down Expand Up @@ -2295,7 +2306,7 @@ async def list_links_eth(self,
neighbor_id_secondary_group,
address_id_secondary_group)

basequery = (f"SELECT * FROM"
basequery = ("SELECT * FROM"
" address_transactions WHERE "
"address_id_group = %s AND address_id = %s "
"AND is_outgoing = %s ")
Expand Down
2 changes: 1 addition & 1 deletion gsrest/errors/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def nodeNotFoundException(network, node_type: NodeType, id):
class AddressNotFoundException(NotFoundException):
def __init__(self, network, address, no_external_txs=False):
address = address_to_user_format(network, address)
reason = f" because it has no external transactions" \
reason = " because it has no external transactions" \
if no_external_txs else ""

super().__init__(f'Address {address} not found in network '
Expand Down
4 changes: 3 additions & 1 deletion gsrest/service/addresses_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
from gsrest.service.rates_service import get_rates
import gsrest.service.common_service as common
from gsrest.service.common_service import cannonicalize_address
from gsrest.errors import *
from gsrest.errors import (AddressNotFoundException,
ClusterNotFoundException,
DBInconsistencyException)
from gsrest.util.address import address_to_user_format
from openapi_server.models.neighbor_addresses import NeighborAddresses
from openapi_server.models.neighbor_address import NeighborAddress
Expand Down
4 changes: 3 additions & 1 deletion gsrest/service/txs_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
from openapi_server.models.tx_ref import TxRef
from gsrest.service.rates_service import get_rates
from gsrest.util.values import convert_value, convert_token_value
from gsrest.errors import TransactionNotFoundException, NotFoundException, BadUserInputException
from gsrest.errors import (TransactionNotFoundException,
NotFoundException,
BadUserInputException)
from gsrest.util import is_eth_like
from gsrest.util.address import address_to_user_format

Expand Down

0 comments on commit 01900a7

Please sign in to comment.