Skip to content

Commit

Permalink
Remove return value from reserveSlot
Browse files Browse the repository at this point in the history
  • Loading branch information
emizzle committed Sep 19, 2024
1 parent 104bf5e commit 4c22934
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
9 changes: 6 additions & 3 deletions codex/contracts/market.nim
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,14 @@ method canProofBeMarkedAsMissing*(
trace "Proof cannot be marked as missing", msg = e.msg
return false

method reserveSlot*(id: SlotId): Future[bool] {.async.} =
method reserveSlot*(market: OnChainMarket, id: SlotId) {.async.} =
discard await market.contract.reserveSlot(id).confirm(0)

method canReserveSlot*(id: SlotId): Future[bool] {.async.} =
discard await market.contract.canReserveSlot(id).confirm(0)
method canReserveSlot*(
market: OnChainMarket,
id: SlotId): Future[bool] {.async.} =

await market.contract.canReserveSlot(id)

Check warning on line 258 in codex/contracts/market.nim

View check run for this annotation

Codecov / codecov/patch

codex/contracts/market.nim#L250-L258

Added lines #L250 - L258 were not covered by tests
method subscribeRequests*(market: OnChainMarket,
callback: OnRequest):
Expand Down
2 changes: 1 addition & 1 deletion codex/contracts/marketplace.nim
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ 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, id: SlotId): bool {.contract.}
proc reserveSlot*(marketplace: Marketplace, id: SlotId): ?TransactionResponse {.contract.}
proc canReserveSlot*(marketplace: Marketplace, id: SlotId): bool {.contract, view.}

Check warning on line 56 in codex/contracts/marketplace.nim

View check run for this annotation

Codecov / codecov/patch

codex/contracts/marketplace.nim#L54-L56

Added lines #L54 - L56 were not covered by tests
10 changes: 8 additions & 2 deletions codex/market.nim
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,16 @@ method canProofBeMarkedAsMissing*(market: Market,
period: Period): Future[bool] {.base, async.} =
raiseAssert("not implemented")

method reserveSlot*(id: SlotId): Future[bool] {.base, async.} =
method reserveSlot*(

Check warning on line 164 in codex/market.nim

View check run for this annotation

Codecov / codecov/patch

codex/market.nim#L164

Added line #L164 was not covered by tests
market: Market,
id: SlotId) {.base, async.} =

raiseAssert("not implemented")

method canReserveSlot*(id: SlotId): Future[bool] {.base, async.} =
method canReserveSlot*(
market: Market,
id: SlotId): Future[bool] {.base, async.} =

raiseAssert("not implemented")

Check warning on line 175 in codex/market.nim

View check run for this annotation

Codecov / codecov/patch

codex/market.nim#L166-L175

Added lines #L166 - L175 were not covered by tests
method subscribeFulfillment*(market: Market,
Expand Down
2 changes: 1 addition & 1 deletion vendor/codex-contracts-eth

0 comments on commit 4c22934

Please sign in to comment.