diff --git a/codex/contracts/market.nim b/codex/contracts/market.nim index 1595b449..3ca0d0e6 100644 --- a/codex/contracts/market.nim +++ b/codex/contracts/market.nim @@ -247,6 +247,21 @@ method canProofBeMarkedAsMissing*( trace "Proof cannot be marked as missing", msg = e.msg return false +method reserveSlot*( + market: OnChainMarket, + requestId: RequestId, + slotIndex: UInt256) {.async.} = + + convertEthersError: + discard await market.contract.reserveSlot(requestId, slotIndex).confirm(0) + +method canReserveSlot*( + market: OnChainMarket, + requestId: RequestId, + slotIndex: UInt256): Future[bool] {.async.} = + + await market.contract.canReserveSlot(requestId, slotIndex) + method subscribeRequests*(market: OnChainMarket, callback: OnRequest): Future[MarketSubscription] {.async.} = diff --git a/codex/contracts/marketplace.nim b/codex/contracts/marketplace.nim index f98b9a80..6425bfa0 100644 --- a/codex/contracts/marketplace.nim +++ b/codex/contracts/marketplace.nim @@ -51,3 +51,6 @@ proc getPointer*(marketplace: Marketplace, id: SlotId): uint8 {.contract, view.} proc submitProof*(marketplace: Marketplace, id: SlotId, proof: Groth16Proof): ?TransactionResponse {.contract.} proc markProofAsMissing*(marketplace: Marketplace, id: SlotId, period: UInt256): ?TransactionResponse {.contract.} + +proc reserveSlot*(marketplace: Marketplace, requestId: RequestId, slotIndex: UInt256): ?TransactionResponse {.contract.} +proc canReserveSlot*(marketplace: Marketplace, requestId: RequestId, slotIndex: UInt256): bool {.contract, view.} diff --git a/codex/market.nim b/codex/market.nim index 245c28d5..89e6231a 100644 --- a/codex/market.nim +++ b/codex/market.nim @@ -161,6 +161,20 @@ method canProofBeMarkedAsMissing*(market: Market, period: Period): Future[bool] {.base, async.} = raiseAssert("not implemented") +method reserveSlot*( + market: Market, + requestId: RequestId, + slotIndex: UInt256) {.base, async.} = + + raiseAssert("not implemented") + +method canReserveSlot*( + market: Market, + requestId: RequestId, + slotIndex: UInt256): Future[bool] {.base, async.} = + + raiseAssert("not implemented") + method subscribeFulfillment*(market: Market, callback: OnFulfillment): Future[Subscription] {.base, async.} = diff --git a/vendor/codex-contracts-eth b/vendor/codex-contracts-eth index 558bf645..33010bd2 160000 --- a/vendor/codex-contracts-eth +++ b/vendor/codex-contracts-eth @@ -1 +1 @@ -Subproject commit 558bf645c3dc385437a3e695bba57e7dba1375fb +Subproject commit 33010bd20cfdc3d589be25782052796af580ca83