From 761a0bd629f4803b8631c2956f8ab7ef409ca96c Mon Sep 17 00:00:00 2001 From: Joewizy Date: Sat, 30 Nov 2024 05:25:43 +0100 Subject: [PATCH] fixed-code-modification --- apps/dashboard_app/helpers/loans_table.py | 11 --------- apps/dashboard_app/helpers/protocol_stats.py | 4 ++-- apps/data_handler/README.md | 24 -------------------- 3 files changed, 2 insertions(+), 37 deletions(-) diff --git a/apps/dashboard_app/helpers/loans_table.py b/apps/dashboard_app/helpers/loans_table.py index 12f4c88d..db16de8b 100644 --- a/apps/dashboard_app/helpers/loans_table.py +++ b/apps/dashboard_app/helpers/loans_table.py @@ -15,17 +15,6 @@ def get_protocol(state: State) -> str: Takes a parameter of State which gets the loan entities and returns the string. """ - # TODO: Improve the inference. - if isinstance(state, ZkLendState): - return "zkLend" - if isinstance(state, NostraAlphaState) and not isinstance( - state, NostraMainnetState - ): - return "Nostra Alpha" - if isinstance(state, NostraMainnetState): - return "Nostra Mainnet" - raise ValueError - return state.get_protocol_name diff --git a/apps/dashboard_app/helpers/protocol_stats.py b/apps/dashboard_app/helpers/protocol_stats.py index b2c92aa3..40ccb878 100644 --- a/apps/dashboard_app/helpers/protocol_stats.py +++ b/apps/dashboard_app/helpers/protocol_stats.py @@ -75,7 +75,7 @@ def get_supply_stats( for state in states: protocol = get_protocol(state=state) token_supplies = {} - for token in TOKEN_SETTINGS.items(): + for token in TOKEN_SETTINGS: ( addresses, selector, @@ -135,7 +135,7 @@ def get_collateral_stats( for state in states: protocol = get_protocol(state=state) token_collaterals = defaultdict(float) - for token in TOKEN_SETTINGS(): + for token in TOKEN_SETTINGS: # TODO: save zkLend amounts under token_addresses? if protocol == "zkLend": token_addresses = [ diff --git a/apps/data_handler/README.md b/apps/data_handler/README.md index 3b4dab2e..ae2f047e 100644 --- a/apps/data_handler/README.md +++ b/apps/data_handler/README.md @@ -96,30 +96,6 @@ docker-compose exec backend bash ``` -## Running Migration Command: -1. Go to root folder `derisk-research` - -### Prepare the Environment -2. Run up db in docker: -``` -docker-compose -f devops/dev/docker-compose.db.yaml up -d --remove-orphans -``` -3. Navigate to the `data_hander` directory: -``` -cd apps/data_handler -``` -4. Install all dependencies: -``` -poetry install -``` -5. Go back to apps folder: -``` -cd .. -``` -5. Run migration command: -``` -alembic -c data_handler/alembic.ini revision --autogenerate -m "your migration message here" -======= ## How to run migration command: 1. Set up `.env.dev` into `derisk-research/apps/data_handler` 2. Go back to `derisk-research/apps` directory