diff --git a/codex/contracts/market.nim b/codex/contracts/market.nim index fdddcb220..6e9ffb87a 100644 --- a/codex/contracts/market.nim +++ b/codex/contracts/market.nim @@ -9,6 +9,7 @@ import ../logutils import ../market import ./marketplace import ./proofs +import pkg/chronos export market @@ -98,8 +99,11 @@ method mySlots*(market: OnChainMarket): Future[seq[SlotId]] {.async.} = method requestStorage(market: OnChainMarket, request: StorageRequest){.async.} = convertEthersError: debug "Requesting storage" + debugEcho "approving funds", Moment.now() await market.approveFunds(request.price()) + debugEcho "requesting storage", Moment.now() discard await market.contract.requestStorage(request).confirm(1) + debugEcho "done requesting storage", Moment.now() method getRequest(market: OnChainMarket, id: RequestId): Future[?StorageRequest] {.async.} = diff --git a/tests/integration/testpurchasing.nim b/tests/integration/testpurchasing.nim index 1e9fdbfab..f70427670 100644 --- a/tests/integration/testpurchasing.nim +++ b/tests/integration/testpurchasing.nim @@ -56,24 +56,24 @@ twonodessuite "Purchasing", debug1 = true, debug2 = false: let data = await RandomChunker.example(blocks=2) let cid = client1.upload(data).get let id = client1.requestStorage(cid, - duration=100.u256, + duration=10*60.u256, reward=2.u256, proofProbability=3.u256, - expiry=30, + expiry=5*60, collateral=200.u256, nodes=3.uint, tolerance=1.uint).get - check eventually(client1.purchaseStateIs(id, "submitted"), timeout = 10*1000) + check eventually(client1.purchaseStateIs(id, "submitted"), timeout = 4*60*1000) debugEcho "client state: ", client1.getPurchase(id).?state node1.restart() client1.restart() check eventually client1.purchaseStateIs(id, "submitted") let request = client1.getPurchase(id).get.request.get - check request.ask.duration == 100.u256 + check request.ask.duration == (10*60).u256 check request.ask.reward == 2.u256 check request.ask.proofProbability == 3.u256 - check request.expiry == 30 + check request.expiry == (5*60).u256 check request.ask.collateral == 200.u256 check request.ask.slots == 3'u64 check request.ask.maxSlotLoss == 1'u64