Skip to content

Commit 03f38ed

Browse files
committed
fix import issue
1 parent 1c9ff05 commit 03f38ed

File tree

4 files changed

+15
-16
lines changed

4 files changed

+15
-16
lines changed
Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
""" This module contains all the models used in the database. """
22
from .base import Base
33
from .liquidable_debt import HealthRatioLevel, LiquidableDebt
4-
from .loan_states import (
5-
InterestRate,
6-
LoanState,
7-
ZkLendCollateralDebt,
8-
)
4+
from .loan_states import InterestRate, LoanState, ZkLendCollateralDebt
95
from .order_book import OrderBookModel
6+
from .vesu import VesuPosition
107
from .zklend_events import (
118
AccumulatorsSyncEventModel,
12-
LiquidationEventModel,
13-
WithdrawalEventModel,
149
BorrowingEventModel,
15-
RepaymentEventModel,
16-
DepositEventModel,
1710
CollateralEnabledDisabledEventModel,
11+
DepositEventModel,
12+
LiquidationEventModel,
13+
RepaymentEventModel,
14+
WithdrawalEventModel,
1815
)

apps/data_handler/models/base.py renamed to apps/data_handler/db/models/vesu.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
from sqlalchemy import Column, BigInteger, String
1+
from sqlalchemy import BigInteger, Column, String
22
from sqlalchemy.ext.declarative import declarative_base
33

44
Base = declarative_base()
55

6+
67
class VesuPosition(Base):
78
__tablename__ = "vesu_positions"
89

apps/data_handler/handlers/loan_states/vesu/events.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
"""
66

77
from decimal import Decimal
8-
from sqlalchemy import select
98

10-
from shared.starknet_client import StarknetClient
11-
from shared.db import session
12-
from apps.data_handler.models import VesuPosition
9+
from sqlalchemy import select
1310
from starknet_py.hash.selector import get_selector_from_name
1411

12+
from apps.data_handler.db.crud import DBConnector
13+
from apps.data_handler.db.models import VesuPosition
14+
from apps.shared.starknet_client import StarknetClient
15+
1516

1617
class VesuLoanEntity:
1718
"""
@@ -26,8 +27,8 @@ class VesuLoanEntity:
2627
def __init__(self):
2728
"""Initialize Starknet client and storage."""
2829
self.client = StarknetClient()
29-
self.session = session
30-
# self.mock_db = {}
30+
self.db_connector = DBConnector()
31+
self.session = self.db_connector.Session()
3132
self._cache = {}
3233
self.last_processed_block = 654244 # First VESU event block
3334

apps/data_handler/models/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)