fix: use full package path for utils import in wallet commands
Some checks failed
CLI Tests / test-cli (push) Has been cancelled
Cross-Node Transaction Testing / transaction-test (push) Has been cancelled
Deploy to Testnet / deploy-testnet (push) Has been cancelled
Multi-Node Stress Testing / stress-test (push) Has been cancelled
Security Scanning / security-scan (push) Has been cancelled

- Changed from utils.dual_mode_wallet_adapter to aitbc_cli.utils.dual_mode_wallet_adapter
- Removes need for sys.path manipulation
- Works correctly with spec_from_file_location loading
- Fixes ModuleNotFoundError when core/main.py loads wallet commands
This commit is contained in:
aitbc
2026-05-26 11:00:16 +02:00
parent a70b901072
commit d281eff8ef

View File

@@ -120,10 +120,7 @@ def wallet(ctx, wallet_name: Optional[str], wallet_path: Optional[str], use_daem
ctx.obj["chain_id"] = get_chain_id(default_rpc_url, override=chain_id)
# Initialize dual-mode adapter
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent.parent.parent.parent / "cli"))
from utils.dual_mode_wallet_adapter import DualModeWalletAdapter
from aitbc_cli.utils.dual_mode_wallet_adapter import DualModeWalletAdapter
config = get_config()
adapter = DualModeWalletAdapter(config, use_daemon=use_daemon)
@@ -264,10 +261,7 @@ def list(ctx):
error("Wallet daemon is not available. Falling back to file-based wallet listing.")
# Switch to file mode
from ..config import get_config
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent.parent.parent.parent / "cli"))
from utils.dual_mode_wallet_adapter import DualModeWalletAdapter
from aitbc_cli.utils.dual_mode_wallet_adapter import DualModeWalletAdapter
config = get_config()
adapter = DualModeWalletAdapter(config, use_daemon=False)