From 4d290d92f3f77e3d53545097912d513d414fab69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Uhl=C3=AD=C5=99?= Date: Thu, 9 May 2024 09:34:26 +0200 Subject: [PATCH] fix: correct place to plug confirm --- codex/contracts/market.nim | 2 +- codex/contracts/marketplace.nim | 2 +- codex/purchasing/states/pending.nim | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/codex/contracts/market.nim b/codex/contracts/market.nim index 4e228670..475d16e4 100644 --- a/codex/contracts/market.nim +++ b/codex/contracts/market.nim @@ -92,7 +92,7 @@ method requestStorage(market: OnChainMarket, request: StorageRequest){.async.} = convertEthersError: debug "Requesting storage" await market.approveFunds(request.price()) - await market.contract.requestStorage(request) + discard await market.contract.requestStorage(request).confirm(1) method getRequest(market: OnChainMarket, id: RequestId): Future[?StorageRequest] {.async.} = diff --git a/codex/contracts/marketplace.nim b/codex/contracts/marketplace.nim index 2326ed3f..d4ed4348 100644 --- a/codex/contracts/marketplace.nim +++ b/codex/contracts/marketplace.nim @@ -42,7 +42,7 @@ proc slashMisses*(marketplace: Marketplace): UInt256 {.contract, view.} proc slashPercentage*(marketplace: Marketplace): UInt256 {.contract, view.} proc minCollateralThreshold*(marketplace: Marketplace): UInt256 {.contract, view.} -proc requestStorage*(marketplace: Marketplace, request: StorageRequest) {.contract.} +proc requestStorage*(marketplace: Marketplace, request: StorageRequest): ?TransactionResponse {.contract.} proc fillSlot*(marketplace: Marketplace, requestId: RequestId, slotIndex: UInt256, proof: Groth16Proof) {.contract.} proc withdrawFunds*(marketplace: Marketplace, requestId: RequestId) {.contract.} proc freeSlot*(marketplace: Marketplace, id: SlotId) {.contract.} diff --git a/codex/purchasing/states/pending.nim b/codex/purchasing/states/pending.nim index 467483b1..4852f266 100644 --- a/codex/purchasing/states/pending.nim +++ b/codex/purchasing/states/pending.nim @@ -14,5 +14,5 @@ method run*(state: PurchasePending, machine: Machine): Future[?State] {.async.} codex_purchases_pending.inc() let purchase = Purchase(machine) let request = !purchase.request - await purchase.market.requestStorage(request).confirm(1) + await purchase.market.requestStorage(request) return some State(PurchaseSubmitted())