From bd2fba50c74d5b12580b7a82e69daead423c7cd3 Mon Sep 17 00:00:00 2001 From: Mark Spanbroek Date: Wed, 6 Jul 2022 15:38:02 +0200 Subject: [PATCH] [purchasing] Fix integration test --- codex/purchasing.nim | 3 ++- tests/testIntegration.nim | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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