[purchasing] Fix integration test
This commit is contained in:
parent
4a4588e2a0
commit
bd2fba50c7
|
@ -24,7 +24,7 @@ type
|
||||||
offerExpiryMargin: UInt256
|
offerExpiryMargin: UInt256
|
||||||
request*: StorageRequest
|
request*: StorageRequest
|
||||||
offers*: seq[StorageOffer]
|
offers*: seq[StorageOffer]
|
||||||
selected*: ?StorageOffer
|
selected*: ?Address
|
||||||
PurchaseTimeout* = Timeout
|
PurchaseTimeout* = Timeout
|
||||||
|
|
||||||
const DefaultProofProbability = 100.u256
|
const DefaultProofProbability = 100.u256
|
||||||
|
@ -85,6 +85,7 @@ proc run(purchase: Purchase) {.async.} =
|
||||||
let subscription = await market.subscribeFulfillment(request.id, callback)
|
let subscription = await market.subscribeFulfillment(request.id, callback)
|
||||||
try:
|
try:
|
||||||
await done
|
await done
|
||||||
|
purchase.selected = await market.getHost(request.id)
|
||||||
finally:
|
finally:
|
||||||
await subscription.unsubscribe()
|
await subscription.unsubscribe()
|
||||||
|
|
||||||
|
|
|
@ -107,5 +107,5 @@ ethersuite "Integration tests":
|
||||||
let purchase = waitFor upload().buy().finish()
|
let purchase = waitFor upload().buy().finish()
|
||||||
|
|
||||||
check purchase["error"].getStr == ""
|
check purchase["error"].getStr == ""
|
||||||
check purchase["selected"].len > 0
|
check purchase["selected"].getStr == $accounts[1]
|
||||||
check available().len == 0
|
check available().len == 0
|
||||||
|
|
Loading…
Reference in New Issue