fix: correct place to plug confirm

This commit is contained in:
Adam Uhlíř 2024-05-09 09:34:26 +02:00
parent 5bb912007d
commit 4d290d92f3
No known key found for this signature in database
GPG Key ID: 1D17A9E81F76155B
3 changed files with 3 additions and 3 deletions

View File

@ -92,7 +92,7 @@ method requestStorage(market: OnChainMarket, request: StorageRequest){.async.} =
convertEthersError: convertEthersError:
debug "Requesting storage" debug "Requesting storage"
await market.approveFunds(request.price()) await market.approveFunds(request.price())
await market.contract.requestStorage(request) discard await market.contract.requestStorage(request).confirm(1)
method getRequest(market: OnChainMarket, method getRequest(market: OnChainMarket,
id: RequestId): Future[?StorageRequest] {.async.} = id: RequestId): Future[?StorageRequest] {.async.} =

View File

@ -42,7 +42,7 @@ proc slashMisses*(marketplace: Marketplace): UInt256 {.contract, view.}
proc slashPercentage*(marketplace: Marketplace): UInt256 {.contract, view.} proc slashPercentage*(marketplace: Marketplace): UInt256 {.contract, view.}
proc minCollateralThreshold*(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 fillSlot*(marketplace: Marketplace, requestId: RequestId, slotIndex: UInt256, proof: Groth16Proof) {.contract.}
proc withdrawFunds*(marketplace: Marketplace, requestId: RequestId) {.contract.} proc withdrawFunds*(marketplace: Marketplace, requestId: RequestId) {.contract.}
proc freeSlot*(marketplace: Marketplace, id: SlotId) {.contract.} proc freeSlot*(marketplace: Marketplace, id: SlotId) {.contract.}

View File

@ -14,5 +14,5 @@ method run*(state: PurchasePending, machine: Machine): Future[?State] {.async.}
codex_purchases_pending.inc() codex_purchases_pending.inc()
let purchase = Purchase(machine) let purchase = Purchase(machine)
let request = !purchase.request let request = !purchase.request
await purchase.market.requestStorage(request).confirm(1) await purchase.market.requestStorage(request)
return some State(PurchaseSubmitted()) return some State(PurchaseSubmitted())