Fix poa.py genesis.json format compatibility and exchange.py syntax error
Some checks failed
Blockchain Synchronization Verification / sync-verification (push) Failing after 4s
CLI Tests / test-cli (push) Failing after 4s
Coverage Phase 1 (70% Target) / test-coverage-70 (push) Failing after 25s
Coverage Phase 2 (85% Target) / test-coverage-85 (push) Failing after 16s
Cross-Chain Functionality Tests / test-cross-chain-sync (push) Successful in 6s
Cross-Chain Functionality Tests / test-cross-chain-transactions (push) Successful in 6s
Cross-Chain Functionality Tests / test-multi-chain-consensus (push) Successful in 4s
Cross-Node Transaction Testing / transaction-test (push) Successful in 10s
Deploy to Testnet / deploy-testnet (push) Failing after 18s
Documentation Validation / validate-docs (push) Failing after 25s
Multi-Node Stress Testing / stress-test (push) Has been cancelled
Security Scanning / security-scan (push) Has been cancelled
Documentation Validation / validate-policies-strict (push) Successful in 11s
Integration Tests / test-service-integration (push) Successful in 51s
Multi-Chain Island Architecture Tests / test-multi-chain-island (push) Successful in 10s
Multi-Node Blockchain Health Monitoring / health-check (push) Successful in 8s
Node Failover Simulation / failover-test (push) Failing after 9s
P2P Network Verification / p2p-verification (push) Successful in 20s
Python Tests / test-python (push) Failing after 1m6s
Cross-Chain Functionality Tests / aggregate-results (push) Successful in 3s

- poa.py: Support both flat and nested genesis.json formats (block.hash vs genesis_hash)
- exchange.py: Fix incomplete try/except in pairs function
- genesis.json: Updated to match CLI expected format with nested block structure
This commit is contained in:
OWL
2026-05-26 22:49:51 +02:00
parent dd747a10de
commit c8b83298d4

View File

@@ -484,11 +484,12 @@ class PoAProposer:
self._logger.error(f"Genesis file not found at /var/lib/aitbc/data/{self._config.chain_id}/genesis.json. Cannot create genesis block without genesis.json file.")
raise RuntimeError(f"Genesis file required but not found for chain {self._config.chain_id}. Please create genesis.json at /var/lib/aitbc/data/{self._config.chain_id}/genesis.json")
# Extract genesis data from file
genesis_hash = local_genesis_data.get("genesis_hash")
genesis_timestamp = local_genesis_data.get("timestamp")
genesis_state_root = local_genesis_data.get("state_root")
genesis_allocations = local_genesis_data.get("allocations", [])
# Extract genesis data from file (support both flat and nested formats)
block_data = local_genesis_data.get("block", {})
genesis_hash = local_genesis_data.get("genesis_hash") or block_data.get("hash")
genesis_timestamp = local_genesis_data.get("timestamp") or block_data.get("timestamp")
genesis_state_root = local_genesis_data.get("state_root") or block_data.get("state_root")
genesis_allocations = local_genesis_data.get("allocations", block_data.get("allocations", []))
if not genesis_hash or not genesis_timestamp or not genesis_state_root:
self._logger.error(f"Genesis file missing required fields: genesis_hash, timestamp, or state_root")