From d2fe2b3f3efb4585af70c962ba5853e55ff46074 Mon Sep 17 00:00:00 2001 From: djeck1432 Date: Tue, 17 Dec 2024 22:45:54 +0100 Subject: [PATCH] upgrade seed data method --- web_app/db/seed_data.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/web_app/db/seed_data.py b/web_app/db/seed_data.py index cdf99057..31e3b4aa 100644 --- a/web_app/db/seed_data.py +++ b/web_app/db/seed_data.py @@ -26,8 +26,10 @@ def create_users(session: SessionLocal) -> list[User]: """ users = [] for _ in range(10): + wallet_id = fake.unique.uuid4() + print('wallet_id:', wallet_id) user = User( - wallet_id=fake.unique.uuid4(), + wallet_id=wallet_id, contract_address=fake.address(), is_contract_deployed=fake.boolean(), ) @@ -49,7 +51,7 @@ def create_positions(session: SessionLocal, users: list[User]) -> None: for _ in range(2): position = Position( user_id=user.id, - token_symbol=fake.random_choices( + token_symbol=fake.random_element( elements=[token.name for token in TokenParams.tokens()] ), amount=fake.random_number(digits=5), @@ -157,8 +159,8 @@ def create_vaults(session: SessionLocal, users: list[User]) -> None: # Populate the database users = create_users(session) create_positions(session, users) - create_airdrops(session, users) - create_telegram_users(session, users) + # create_airdrops(session, users) + # create_telegram_users(session, users) create_vaults(session, users) logger.info("Database populated with fake data.")