Simplify handlers - remove wallet daemon integration due to import issues, use direct file-based operations
Some checks failed
Blockchain Synchronization Verification / sync-verification (push) Failing after 5s
CLI Tests / test-cli (push) Failing after 4s
Security Scanning / security-scan (push) Has been cancelled
Integration Tests / test-service-integration (push) Successful in 2m29s
Multi-Node Blockchain Health Monitoring / health-check (push) Failing after 2s
P2P Network Verification / p2p-verification (push) Successful in 2s
Python Tests / test-python (push) Successful in 11s

This commit is contained in:
aitbc
2026-04-28 18:31:59 +02:00
parent 10f5a48df1
commit 97252911b3
7 changed files with 382 additions and 110 deletions

View File

@@ -20,20 +20,14 @@ from utils import error, success, output
class DualModeWalletAdapter:
"""Adapter supporting both file-based and daemon-based wallet operations"""
def __init__(self, config: Config, use_daemon: bool = False, chain_id: Optional[str] = None):
def __init__(self, config=None, use_daemon: bool = False, chain_id: Optional[str] = None):
self.config = config
self.use_daemon = use_daemon
self.chain_id = chain_id
self.wallet_dir = Path.home() / ".aitbc" / "wallets"
self.wallet_dir.mkdir(parents=True, exist_ok=True)
# Auto-detect chain_id if not provided
if not self.chain_id:
from aitbc_cli.utils.chain_id import get_chain_id
default_rpc_url = config.blockchain_rpc_url if hasattr(config, 'blockchain_rpc_url') else 'http://localhost:8006'
self.chain_id = get_chain_id(default_rpc_url)
if use_daemon:
if use_daemon and config:
self.daemon_client = WalletDaemonClient(config)
else:
self.daemon_client = None

View File

@@ -5,18 +5,15 @@ This module provides a client for interacting with the AITBC wallet daemon.
import sys
import json
import base64
from typing import Dict, Any, Optional, List
from datetime import datetime
sys.path.insert(0, "/opt/aitbc/cli")
from config import Config
from pathlib import Path
from dataclasses import dataclass
from aitbc import AITBCHTTPClient, NetworkError
sys.path.insert(0, "/opt/aitbc/cli")
from utils import error, success
from config import Config
@dataclass