From 698baeef35fdf63d8db98b0e9d210d40253f5f5d Mon Sep 17 00:00:00 2001 From: Mark Spanbroek Date: Wed, 27 Jul 2022 16:51:46 +0200 Subject: [PATCH] [purchasing] Remove Purchase.selected There no longer exists a single host that is selected for a contract. --- codex/purchasing.nim | 8 ++------ codex/rest/json.nim | 1 - tests/testIntegration.nim | 1 - 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/codex/purchasing.nim b/codex/purchasing.nim index 5fe2fa88..f5497086 100644 --- a/codex/purchasing.nim +++ b/codex/purchasing.nim @@ -21,7 +21,6 @@ type market: Market clock: Clock request*: StorageRequest - selected*: ?Address PurchaseTimeout* = Timeout const DefaultProofProbability = 100.u256 @@ -77,11 +76,8 @@ proc run(purchase: Purchase) {.async.} = done.complete() let request = purchase.request let subscription = await market.subscribeFulfillment(request.id, callback) - try: - await done - purchase.selected = await market.getHost(request.id) - finally: - await subscription.unsubscribe() + await done + await subscription.unsubscribe() proc withTimeout(future: Future[void]) {.async.} = let expiry = purchase.request.expiry.truncate(int64) diff --git a/codex/rest/json.nim b/codex/rest/json.nim index 3ee7471e..2c0492a6 100644 --- a/codex/rest/json.nim +++ b/codex/rest/json.nim @@ -44,5 +44,4 @@ func `%`*(purchase: Purchase): JsonNode = "finished": purchase.finished, "error": purchase.error.?msg, "request": purchase.request, - "selected": purchase.selected } diff --git a/tests/testIntegration.nim b/tests/testIntegration.nim index 309fcf71..621bebb0 100644 --- a/tests/testIntegration.nim +++ b/tests/testIntegration.nim @@ -103,5 +103,4 @@ ethersuite "Integration tests": let purchase = waitFor upload().buy().finish() check purchase["error"].getStr == "" - check purchase["selected"].getStr == $accounts[1] check available().len == 0