fix: add missing 'to' and 'amount' fields to TransactionRequest model
Some checks failed
Blockchain Synchronization Verification / sync-verification (push) Failing after 9s
Integration Tests / test-service-integration (push) Has been cancelled
Multi-Node Blockchain Health Monitoring / health-check (push) Has been cancelled
P2P Network Verification / p2p-verification (push) Has been cancelled
Python Tests / test-python (push) Has been cancelled
Security Scanning / security-scan (push) Has been cancelled

This commit is contained in:
aitbc
2026-04-28 13:16:08 +02:00
parent d61da16ae6
commit 248de71724

View File

@@ -205,11 +205,13 @@ def _serialize_receipt(receipt: Receipt) -> Dict[str, Any]:
class TransactionRequest(BaseModel):
type: str = Field(description="Transaction type, e.g. TRANSFER, RECEIPT_CLAIM, GPU_MARKETPLACE, EXCHANGE, MESSAGE")
sender: str = Field(alias="from") # Accept both "sender" and "from"
to: str = Field(description="Recipient address")
nonce: int
fee: int = Field(ge=0)
payload: Dict[str, Any]
sig: Optional[str] = Field(default=None, description="Signature payload")
value: Optional[int] = Field(default=None, description="Transaction value (amount to transfer)")
amount: Optional[int] = Field(default=None, description="Transaction amount (alternative to value)")
@model_validator(mode="after")
def normalize_type(self) -> "TransactionRequest": # type: ignore[override]