Files
aitbc/apps/blockchain-node/fix_accounts.py
aitbc 5f03ded7ff fix: replace deprecated datetime.utcnow() with datetime.now(datetime.UTC)
- Replace all 2,087 uses of datetime.utcnow() across 294 files
- Add UTC import to datetime statements where needed
- Addresses Python 3.12+ deprecation warning (report item #3)
2026-04-30 08:36:55 +02:00

15 lines
507 B
Python

from aitbc_chain.database import session_scope, init_db
from aitbc_chain.models import Account
from datetime import datetime, UTC
def fix():
init_db()
with session_scope() as session:
acc = Account(chain_id="ait-mainnet", address="aitbc1genesis", balance=10000000, nonce=0, updated_at=datetime.now(datetime.UTC), account_type="regular", metadata="{}")
session.merge(acc)
session.commit()
print("Added aitbc1genesis to mainnet")
if __name__ == "__main__":
fix()