[purchasing] Remove Purchase.selected

There no longer exists a single host that
is selected for a contract.
This commit is contained in:
Mark Spanbroek 2022-07-27 16:51:46 +02:00 committed by markspanbroek
parent ac6d17e895
commit 698baeef35
3 changed files with 2 additions and 8 deletions

View File

@ -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)

View File

@ -44,5 +44,4 @@ func `%`*(purchase: Purchase): JsonNode =
"finished": purchase.finished,
"error": purchase.error.?msg,
"request": purchase.request,
"selected": purchase.selected
}

View File

@ -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