From 1904c9d784195808ffddf63769f53c9c0c398074 Mon Sep 17 00:00:00 2001 From: rilesdun Date: Sun, 17 Sep 2023 15:04:31 +0000 Subject: [PATCH] final pylint reconfigurations --- app.py | 4 ++-- src/accounts/sons/active_sons.py | 2 +- src/accounts/witnesses/witnesses.py | 4 ++-- src/blocks.py | 2 +- src/supply/max_supply.py | 9 --------- 5 files changed, 6 insertions(+), 15 deletions(-) diff --git a/app.py b/app.py index ee0e5c3..a1b3c09 100644 --- a/app.py +++ b/app.py @@ -156,7 +156,7 @@ def account_info(account_name): return jsonify(account_info=info) except AccountDoesNotExistsException: return jsonify(error="Account does not exist"), 404 - except Exception as error: + except Exception as error: # pylint: disable=broad-except return str(error), 400 @app.route('/api/accounts/witnesses', methods=['GET']) @@ -189,4 +189,4 @@ def active_sons(): return sons if __name__ == '__main__': - app.run(app) + app.run() diff --git a/src/accounts/sons/active_sons.py b/src/accounts/sons/active_sons.py index 8203ece..1632ff9 100644 --- a/src/accounts/sons/active_sons.py +++ b/src/accounts/sons/active_sons.py @@ -29,7 +29,7 @@ def get_active_sons(): results.append(obj) son_count += 1 object_id_number += 1 - except Exception as error: + except Exception as error: # pylint: disable=broad-except print(f"Error fetching object {object_id}: {error}", file=sys.stderr) break diff --git a/src/accounts/witnesses/witnesses.py b/src/accounts/witnesses/witnesses.py index 83f842d..2cf9c00 100644 --- a/src/accounts/witnesses/witnesses.py +++ b/src/accounts/witnesses/witnesses.py @@ -27,10 +27,10 @@ def list_active_witnesses(): account = Account(witness["witness_account"], blockchain_instance=peerplays) witness_info.append({ "account_name": account['name'], - "witness_data": {key: value for key, value in witness.items()} + "witness_data": dict(witness.items()) }) - witness_info = sorted(witness_info, key=lambda x: x['witness_data']['total_votes'], + witness_info = sorted(witness_info, key=lambda x: x['witness_data']['total_votes'], reverse=True) logger.info("Successfully fetched %s active witnesses", len(witness_info)) diff --git a/src/blocks.py b/src/blocks.py index ee55f61..ece0b17 100644 --- a/src/blocks.py +++ b/src/blocks.py @@ -52,7 +52,7 @@ def get_block_info(block_num=None): logger.info("Successfully fetched block %s", block_num) return block_info - except Exception as exception: + except Exception as exception: # pylint: disable=broad-except logger.error("Error fetching block %s: %s", block_num, exception, exc_info=True) return None \ No newline at end of file diff --git a/src/supply/max_supply.py b/src/supply/max_supply.py index c09ea43..181da93 100644 --- a/src/supply/max_supply.py +++ b/src/supply/max_supply.py @@ -6,15 +6,6 @@ from src.supply.common import get_supplies, peerplays, ASSET_IDS -ASSET_IDS = { - "ppy": "1.3.0", - "btfun": "1.3.1", - "bitcoin": "1.3.22", - "hive": "1.3.24", - "hbd": "1.3.23", - # Add more mappings as needed -} - def max_supply(coin_name): """ This endpoint returns the maximum supply for the given coin name.