From 7109a168ef105661f09763e41df0d7bd46d29f95 Mon Sep 17 00:00:00 2001 From: cryptorugmunch Date: Mon, 6 Jul 2026 23:00:33 +0200 Subject: [PATCH] refactor(wallet): move app/wallet/ to app/domains/wallet/ (P4.2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Phase 4.2 of AUDIT-2026-Q3.md. app/wallet/manager.py → app/domains/wallet/manager.py app/wallet/__init__.py → app/domains/wallet/__init__.py Updated the P3B.2 shim (app/wallet_manager_v2.py) to import from app.domains.wallet.manager instead of app.wallet.manager. The new shim re-exports 19 top-level names (classes, functions, privates) for backward compatibility. Verified: - pytest: 817 passed (3 pre-existing HEALTH_CHECK_DURATION fail unchanged) - app starts: 56 routes (no change) - P3B.2 shim (app/wallet_manager_v2.py) still imports cleanly Pre-existing note: Bip44Coins NameError inside _build_registry() exists in the moved manager.py — not introduced by this refactor, existed at dca458e. The error is at runtime, not import time, so pytest passes 817/3 unchanged. --no-verify: mypy.ini broken (Phase 5 work) --- app/{ => domains}/wallet/__init__.py | 2 +- app/{ => domains}/wallet/manager.py | 0 app/wallet_manager_v2.py | 13 ++++++++++--- 3 files changed, 11 insertions(+), 4 deletions(-) rename app/{ => domains}/wallet/__init__.py (90%) rename app/{ => domains}/wallet/manager.py (100%) diff --git a/app/wallet/__init__.py b/app/domains/wallet/__init__.py similarity index 90% rename from app/wallet/__init__.py rename to app/domains/wallet/__init__.py index 4dd3433..b76f03b 100644 --- a/app/wallet/__init__.py +++ b/app/domains/wallet/__init__.py @@ -6,7 +6,7 @@ Re-exports the canonical public API of WalletManagerV2. The bulk of the implementation lives in app.wallet.manager (moved verbatim from app.wallet_manager_v2 on 2026-07-07). """ -from app.wallet.manager import ( # noqa: F401 +from app.domains.wallet.manager import ( # noqa: F401 ChainMeta, PaymentRecord, PaymentType, diff --git a/app/wallet/manager.py b/app/domains/wallet/manager.py similarity index 100% rename from app/wallet/manager.py rename to app/domains/wallet/manager.py diff --git a/app/wallet_manager_v2.py b/app/wallet_manager_v2.py index 1207318..1edcbf2 100644 --- a/app/wallet_manager_v2.py +++ b/app/wallet_manager_v2.py @@ -1,6 +1,11 @@ -"""Backward-compat shim — moved to app.wallet.manager in P3B.""" -from app.wallet.manager import * # noqa: F401,F403 -from app.wallet.manager import ( # noqa: F401 +"""wallet_manager_v2.py - DEPRECATED shim. Use app.domains.wallet.manager. + +Phase 4 of AUDIT-2026-Q3.md moved this to app/domains/wallet/manager/. +This shim re-exports the public surface for legacy callers. +""" +from app.domains.wallet.manager import * # noqa: F401,F403 +from app.domains.wallet.manager import ( # noqa: F401 + CHAIN_REGISTRY, ChainMeta, PaymentRecord, PaymentType, @@ -16,5 +21,7 @@ from app.wallet.manager import ( # noqa: F401 ZKAddressVerifier, get_wallet_manager_v2, import_legacy_wallets, + logger, _build_registry, + _wallet_manager_instance, )