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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user