diff --git a/codex/purchasing.nim b/codex/purchasing.nim index 084ec9a4..82a0d9fc 100644 --- a/codex/purchasing.nim +++ b/codex/purchasing.nim @@ -24,7 +24,7 @@ type offerExpiryMargin: UInt256 request*: StorageRequest offers*: seq[StorageOffer] - selected*: ?StorageOffer + selected*: ?Address PurchaseTimeout* = Timeout const DefaultProofProbability = 100.u256 @@ -85,6 +85,7 @@ proc run(purchase: Purchase) {.async.} = let subscription = await market.subscribeFulfillment(request.id, callback) try: await done + purchase.selected = await market.getHost(request.id) finally: await subscription.unsubscribe() diff --git a/tests/testIntegration.nim b/tests/testIntegration.nim index 4f4d3dd9..b6539e27 100644 --- a/tests/testIntegration.nim +++ b/tests/testIntegration.nim @@ -107,5 +107,5 @@ ethersuite "Integration tests": let purchase = waitFor upload().buy().finish() check purchase["error"].getStr == "" - check purchase["selected"].len > 0 + check purchase["selected"].getStr == $accounts[1] check available().len == 0