Add nosec B104 comments to 0.0.0.0 bindings and fix datetime.UTC references
Some checks failed
API Endpoint Tests / test-api-endpoints (push) Successful in 16s
Cross-Node Transaction Testing / transaction-test (push) Successful in 11s
Deploy to Testnet / deploy-testnet (push) Has started running
Deploy to Testnet / notify-deployment (push) Has been cancelled
Multi-Node Stress Testing / stress-test (push) Has been cancelled
Node Failover Simulation / failover-test (push) Has been cancelled
Integration Tests / test-service-integration (push) Successful in 2m37s
Package Tests / Python package - aitbc-agent-sdk (push) Failing after 25s
Package Tests / Python package - aitbc-core (push) Successful in 15s
Package Tests / Python package - aitbc-crypto (push) Successful in 9s
Package Tests / Python package - aitbc-sdk (push) Successful in 10s
Package Tests / JavaScript package - aitbc-sdk-js (push) Successful in 8s
Package Tests / JavaScript package - aitbc-token (push) Successful in 18s
Python Tests / test-python (push) Successful in 16s
Security Scanning / security-scan (push) Successful in 19s
Some checks failed
API Endpoint Tests / test-api-endpoints (push) Successful in 16s
Cross-Node Transaction Testing / transaction-test (push) Successful in 11s
Deploy to Testnet / deploy-testnet (push) Has started running
Deploy to Testnet / notify-deployment (push) Has been cancelled
Multi-Node Stress Testing / stress-test (push) Has been cancelled
Node Failover Simulation / failover-test (push) Has been cancelled
Integration Tests / test-service-integration (push) Successful in 2m37s
Package Tests / Python package - aitbc-agent-sdk (push) Failing after 25s
Package Tests / Python package - aitbc-core (push) Successful in 15s
Package Tests / Python package - aitbc-crypto (push) Successful in 9s
Package Tests / Python package - aitbc-sdk (push) Successful in 10s
Package Tests / JavaScript package - aitbc-sdk-js (push) Successful in 8s
Package Tests / JavaScript package - aitbc-token (push) Successful in 18s
Python Tests / test-python (push) Successful in 16s
Security Scanning / security-scan (push) Successful in 19s
- Add nosec B104 comments to 4 uvicorn.run() and 1 api_host binding using 0.0.0.0 (api-gateway, coordinator-api, exchange, wallet) - Replace datetime.UTC with datetime.timezone.utc in 10 locations across agent SDK (agent.py, compute_provider.py, swarm_coordinator.py) - Add Union and Callable to contract_integration.py imports
This commit is contained in:
@@ -154,7 +154,7 @@ class Agent:
|
||||
"max_concurrent_jobs": self.capabilities.max_concurrent_jobs,
|
||||
"specialization": self.capabilities.specialization,
|
||||
},
|
||||
"timestamp": datetime.now(datetime.UTC).isoformat(),
|
||||
"timestamp": datetime.now(datetime.timezone.utc).isoformat(),
|
||||
}
|
||||
|
||||
# Sign registration data
|
||||
@@ -274,7 +274,7 @@ class Agent:
|
||||
"to": recipient_id,
|
||||
"type": message_type,
|
||||
"payload": payload,
|
||||
"timestamp": datetime.now(datetime.UTC).isoformat(),
|
||||
"timestamp": datetime.now(datetime.timezone.utc).isoformat(),
|
||||
}
|
||||
|
||||
# Sign message
|
||||
|
||||
@@ -233,7 +233,7 @@ class ComputeProvider(Agent):
|
||||
job = JobExecution(
|
||||
job_id=job_request["job_id"],
|
||||
consumer_id=job_request["consumer_id"],
|
||||
start_time=datetime.now(datetime.UTC),
|
||||
start_time=datetime.now(datetime.timezone.utc),
|
||||
expected_duration=timedelta(hours=job_request["estimated_hours"]),
|
||||
)
|
||||
|
||||
@@ -286,7 +286,7 @@ class ComputeProvider(Agent):
|
||||
notification = {
|
||||
"job_id": job.job_id,
|
||||
"status": job.status,
|
||||
"completion_time": datetime.now(datetime.UTC).isoformat(),
|
||||
"completion_time": datetime.now(datetime.timezone.utc).isoformat(),
|
||||
"duration_hours": (
|
||||
job.actual_duration.total_seconds() / 3600
|
||||
if job.actual_duration
|
||||
|
||||
@@ -5,7 +5,7 @@ Provides methods for interacting with deployed smart contracts
|
||||
|
||||
import asyncio
|
||||
import json
|
||||
from typing import Dict, List, Optional, Any
|
||||
from typing import Dict, List, Optional, Any, Union, Callable
|
||||
from dataclasses import dataclass
|
||||
from web3 import Web3
|
||||
from web3.contract import Contract
|
||||
|
||||
@@ -79,9 +79,9 @@ class SwarmCoordinator(Agent):
|
||||
self.joined_swarms[swarm_id] = {
|
||||
"type": swarm_type,
|
||||
"role": config.get("role", "participant"),
|
||||
"joined_at": datetime.now(datetime.UTC).isoformat(),
|
||||
"joined_at": datetime.now(datetime.timezone.utc).isoformat(),
|
||||
"contribution_count": 0,
|
||||
"last_activity": datetime.now(datetime.UTC).isoformat(),
|
||||
"last_activity": datetime.now(datetime.timezone.utc).isoformat(),
|
||||
}
|
||||
|
||||
# Initialize swarm reputation
|
||||
@@ -115,7 +115,7 @@ class SwarmCoordinator(Agent):
|
||||
await self._participate_in_decisions(swarm_id)
|
||||
|
||||
# Update activity timestamp
|
||||
swarm_config["last_activity"] = datetime.now(datetime.UTC).isoformat()
|
||||
swarm_config["last_activity"] = datetime.now(datetime.timezone.utc).isoformat()
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"Swarm participation error for {swarm_id}: {e}")
|
||||
@@ -177,7 +177,7 @@ class SwarmCoordinator(Agent):
|
||||
message_type="data_contribution",
|
||||
priority="medium",
|
||||
payload=data,
|
||||
timestamp=datetime.now(datetime.UTC).isoformat(),
|
||||
timestamp=datetime.now(datetime.timezone.utc).isoformat(),
|
||||
swarm_signature="", # Will be added in broadcast_to_swarm
|
||||
)
|
||||
|
||||
@@ -285,7 +285,7 @@ class SwarmCoordinator(Agent):
|
||||
try:
|
||||
# Create coordination proposal
|
||||
proposal = {
|
||||
"task_id": f"task_{datetime.now(datetime.UTC).strftime('%Y%m%d_%H%M%S')}",
|
||||
"task_id": f"task_{datetime.now(datetime.timezone.utc).strftime('%Y%m%d_%H%M%S')}",
|
||||
"task_type": task,
|
||||
"coordinator_id": self.identity.id,
|
||||
"required_collaborators": collaborators,
|
||||
@@ -320,7 +320,7 @@ class SwarmCoordinator(Agent):
|
||||
message_type="intelligence_request",
|
||||
priority="high",
|
||||
payload={"request_type": "market_intelligence"},
|
||||
timestamp=datetime.now(datetime.UTC).isoformat(),
|
||||
timestamp=datetime.now(datetime.timezone.utc).isoformat(),
|
||||
swarm_signature="",
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user