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
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:
@@ -58,6 +58,10 @@ class MarketplaceService:
|
|||||||
"""Create a new marketplace offer"""
|
"""Create a new marketplace offer"""
|
||||||
try:
|
try:
|
||||||
logger.info(f"create_offer called with data keys: {offer_data.keys()}")
|
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)
|
offer = MarketplaceOffer(**offer_data)
|
||||||
self.session.add(offer)
|
self.session.add(offer)
|
||||||
await self.session.commit()
|
await self.session.commit()
|
||||||
|
|||||||
@@ -58,6 +58,10 @@ class MarketplaceService:
|
|||||||
"""Create a new marketplace offer"""
|
"""Create a new marketplace offer"""
|
||||||
try:
|
try:
|
||||||
logger.info(f"create_offer called with data keys: {offer_data.keys()}")
|
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)
|
offer = MarketplaceOffer(**offer_data)
|
||||||
self.session.add(offer)
|
self.session.add(offer)
|
||||||
await self.session.commit()
|
await self.session.commit()
|
||||||
|
|||||||
Reference in New Issue
Block a user