Skip to content

Commit

Permalink
fixed-code-modification
Browse files Browse the repository at this point in the history
  • Loading branch information
Joewizy committed Nov 30, 2024
1 parent b0498d9 commit 761a0bd
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 37 deletions.
11 changes: 0 additions & 11 deletions apps/dashboard_app/helpers/loans_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
4 changes: 2 additions & 2 deletions apps/dashboard_app/helpers/protocol_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 = [
Expand Down
24 changes: 0 additions & 24 deletions apps/data_handler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 761a0bd

Please sign in to comment.