feat: GET /api/getWhitelist (walletList) + WalletAdmin; verifier grace no longer resurrects false rows
This commit is contained in:
1 parent
7ae6b8f4f8
commit
b00bd4f740
7 files changed
+83
-8
No files matched your search
@@ -13,6 +13,7 @@ from app.models import (
|
||||
Dapp,
|
||||
Token,
|
||||
Version,
|
||||
Wallet,
|
||||
Base,
|
||||
engine,
|
||||
)
|
||||
@@ -105,11 +106,28 @@ def seed():
|
||||
)
|
||||
)
|
||||
seed_dapps(session)
|
||||
seed_wallets(session)
|
||||
session.commit()
|
||||
finally:
|
||||
session.close()
|
||||
|
||||
|
||||
SEED_WALLETS = ["susukudaliar", "vexessential"]
|
||||
|
||||
|
||||
def _utc_now_iso() -> str:
|
||||
from datetime import datetime, timezone
|
||||
|
||||
return datetime.now(timezone.utc).isoformat(timespec="seconds")
|
||||
|
||||
|
||||
def seed_wallets(session):
|
||||
if session.query(Wallet).count() != 0:
|
||||
return
|
||||
for account in SEED_WALLETS:
|
||||
session.add(Wallet(account=account, created_at=_utc_now_iso()))
|
||||
|
||||
|
||||
def _image_extension(content_type: str, url: str) -> str:
|
||||
ext = IMAGE_EXT.get((content_type or "").split(";")[0].strip().lower())
|
||||
if ext:
|
||||
@@ -224,4 +242,12 @@ def increment_dapp_counter(dapp_id: int):
|
||||
{"dapp_id": dapp_id},
|
||||
).fetchone()
|
||||
session.commit()
|
||||
return row[0] if row else None
|
||||
return row[0] if row else None
|
||||
|
||||
|
||||
def list_wallets():
|
||||
session = SessionLocal()
|
||||
try:
|
||||
return [w.account for w in session.query(Wallet).order_by(Wallet.id.asc()).all()]
|
||||
finally:
|
||||
session.close()
|
||||
Reference in new issue
Block a user