feat: add blockchain state and balance endpoints with multi-chain support

- Add GET /state endpoint to blockchain RPC router for chain state information
- Add GET /rpc/getBalance/{address} endpoint for account balance queries
- Add GET /rpc/head endpoint to retrieve current chain head block
- Add GET /rpc/transactions endpoint for latest transaction listing
- Add chain-specific wallet balance endpoint to wallet daemon
- Add blockchain state CLI command with --all-chains flag for multi-chain queries
This commit is contained in:
oib
2026-03-07 20:00:21 +01:00
parent d92d7a087f
commit 36be9c814e
10 changed files with 469 additions and 110 deletions

View File

@@ -41,7 +41,7 @@ class Level5IntegrationTesterImproved:
"""Improved test suite for AITBC CLI Level 5 integration and edge cases"""
def __init__(self):
self.runner = CliRunner()
self.runner = CliRunner(env={'PYTHONUNBUFFERED': '1'})
self.test_results = {
'passed': 0,
'failed': 0,
@@ -57,10 +57,18 @@ class Level5IntegrationTesterImproved:
print(f"🧹 Cleaned up test environment")
def run_test(self, test_name, test_func):
"""Run a single test and track results"""
"""Run a single test and track results with comprehensive error handling"""
print(f"\n🧪 Running: {test_name}")
try:
result = test_func()
# Redirect stderr to avoid I/O operation errors
import io
import sys
from contextlib import redirect_stderr
stderr_buffer = io.StringIO()
with redirect_stderr(stderr_buffer):
result = test_func()
if result:
print(f"✅ PASSED: {test_name}")
self.test_results['passed'] += 1