fix: add wallet to provider mapping in marketplace create_offer
Some checks failed
Cross-Node Transaction Testing / transaction-test (push) Successful in 3s
Deploy to Testnet / deploy-testnet (push) Successful in 1m9s
Integration Tests / test-service-integration (push) Successful in 2m38s
Multi-Node Stress Testing / stress-test (push) Successful in 4s
Node Failover Simulation / failover-test (push) Has been cancelled
Python Tests / test-python (push) Has been cancelled
Security Scanning / security-scan (push) Has been cancelled

- Map wallet parameter from CLI to provider field in database
- Fixes NotNullViolationError on provider column
- CLI sends wallet, database expects provider column (NOT NULL)
- Added mapping logic in create_offer method
This commit is contained in:
aitbc
2026-05-08 19:26:38 +02:00
parent 6549483b18
commit 528c822f09
2 changed files with 8 additions and 0 deletions

View File

@@ -58,6 +58,10 @@ class MarketplaceService:
"""Create a new marketplace offer"""
try:
logger.info(f"create_offer called with data keys: {offer_data.keys()}")
# Map wallet to provider for CLI compatibility
if 'wallet' in offer_data and 'provider' not in offer_data:
offer_data['provider'] = offer_data['wallet']
logger.info(f"Mapped wallet '{offer_data['wallet']}' to provider")
offer = MarketplaceOffer(**offer_data)
self.session.add(offer)
await self.session.commit()

View File

@@ -58,6 +58,10 @@ class MarketplaceService:
"""Create a new marketplace offer"""
try:
logger.info(f"create_offer called with data keys: {offer_data.keys()}")
# Map wallet to provider for CLI compatibility
if 'wallet' in offer_data and 'provider' not in offer_data:
offer_data['provider'] = offer_data['wallet']
logger.info(f"Mapped wallet '{offer_data['wallet']}' to provider")
offer = MarketplaceOffer(**offer_data)
self.session.add(offer)
await self.session.commit()