diff --git a/codex/contracts/market.nim b/codex/contracts/market.nim index 6dd7e2b3..69383065 100644 --- a/codex/contracts/market.nim +++ b/codex/contracts/market.nim @@ -176,7 +176,7 @@ method fillSlot(market: OnChainMarket, method freeSlot*(market: OnChainMarket, slotId: SlotId) {.async.} = convertEthersError: - var freeSlot: Future[?TransactionResponse] + var freeSlot: Future[Confirmable] if rewardRecipient =? market.rewardRecipient: # If --reward-recipient specified, use it as the reward recipient, and use # the SP's address as the collateral recipient diff --git a/codex/contracts/marketplace.nim b/codex/contracts/marketplace.nim index 6425bfa0..f3bac79d 100644 --- a/codex/contracts/marketplace.nim +++ b/codex/contracts/marketplace.nim @@ -23,12 +23,12 @@ 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): ?TransactionResponse {.contract.} -proc fillSlot*(marketplace: Marketplace, requestId: RequestId, slotIndex: UInt256, proof: Groth16Proof): ?TransactionResponse {.contract.} -proc withdrawFunds*(marketplace: Marketplace, requestId: RequestId): ?TransactionResponse {.contract.} -proc withdrawFunds*(marketplace: Marketplace, requestId: RequestId, withdrawAddress: Address): ?TransactionResponse {.contract.} -proc freeSlot*(marketplace: Marketplace, id: SlotId): ?TransactionResponse {.contract.} -proc freeSlot*(marketplace: Marketplace, id: SlotId, rewardRecipient: Address, collateralRecipient: Address): ?TransactionResponse {.contract.} +proc requestStorage*(marketplace: Marketplace, request: StorageRequest): Confirmable {.contract.} +proc fillSlot*(marketplace: Marketplace, requestId: RequestId, slotIndex: UInt256, proof: Groth16Proof): Confirmable {.contract.} +proc withdrawFunds*(marketplace: Marketplace, requestId: RequestId): Confirmable {.contract.} +proc withdrawFunds*(marketplace: Marketplace, requestId: RequestId, withdrawAddress: Address): Confirmable {.contract.} +proc freeSlot*(marketplace: Marketplace, id: SlotId): Confirmable {.contract.} +proc freeSlot*(marketplace: Marketplace, id: SlotId, rewardRecipient: Address, collateralRecipient: Address): Confirmable {.contract.} proc getRequest*(marketplace: Marketplace, id: RequestId): StorageRequest {.contract, view.} proc getHost*(marketplace: Marketplace, id: SlotId): Address {.contract, view.} proc getActiveSlot*(marketplace: Marketplace, id: SlotId): Slot {.contract, view.} @@ -49,8 +49,8 @@ proc willProofBeRequired*(marketplace: Marketplace, id: SlotId): bool {.contract proc getChallenge*(marketplace: Marketplace, id: SlotId): array[32, byte] {.contract, view.} 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 submitProof*(marketplace: Marketplace, id: SlotId, proof: Groth16Proof): Confirmable {.contract.} +proc markProofAsMissing*(marketplace: Marketplace, id: SlotId, period: UInt256): Confirmable {.contract.} -proc reserveSlot*(marketplace: Marketplace, requestId: RequestId, slotIndex: UInt256): ?TransactionResponse {.contract.} +proc reserveSlot*(marketplace: Marketplace, requestId: RequestId, slotIndex: UInt256): Confirmable {.contract.} proc canReserveSlot*(marketplace: Marketplace, requestId: RequestId, slotIndex: UInt256): bool {.contract, view.} diff --git a/tests/contracts/testDeployment.nim b/tests/contracts/testDeployment.nim index 4101b71a..f89e28a8 100644 --- a/tests/contracts/testDeployment.nim +++ b/tests/contracts/testDeployment.nim @@ -9,7 +9,7 @@ import ../checktest type MockProvider = ref object of Provider chainId*: UInt256 -method getChainId*(provider: MockProvider): Future[UInt256] {.async.} = +method getChainId*(provider: MockProvider): Future[UInt256] {.async: (raises:[ProviderError]).} = return provider.chainId proc configFactory(): CodexConf = diff --git a/tests/contracts/time.nim b/tests/contracts/time.nim index cd6aac1b..11bd1b6d 100644 --- a/tests/contracts/time.nim +++ b/tests/contracts/time.nim @@ -1,4 +1,5 @@ import pkg/ethers +import pkg/serde proc currentTime*(provider: Provider): Future[UInt256] {.async.} = return (!await provider.getBlock(BlockTag.pending)).timestamp diff --git a/vendor/nim-ethers b/vendor/nim-ethers index 5b170adc..507ac6a4 160000 --- a/vendor/nim-ethers +++ b/vendor/nim-ethers @@ -1 +1 @@ -Subproject commit 5b170adcb1ffb1dbb273d1b7679bf3d9a08adb76 +Subproject commit 507ac6a4cc71cec9be7693fa393db4a49b52baf9 diff --git a/vendor/nim-json-rpc b/vendor/nim-json-rpc index 0bf2bcbe..0408795b 160000 --- a/vendor/nim-json-rpc +++ b/vendor/nim-json-rpc @@ -1 +1 @@ -Subproject commit 0bf2bcbe74a18a3c7a709d57108bb7b51e748a92 +Subproject commit 0408795be95c00d75e96eaef6eae8a9c734014f5 diff --git a/vendor/nim-json-serialization b/vendor/nim-json-serialization index bb53d49c..5127b26e 160000 --- a/vendor/nim-json-serialization +++ b/vendor/nim-json-serialization @@ -1 +1 @@ -Subproject commit bb53d49caf2a6c6cf1df365ba84af93cdcfa7aa3 +Subproject commit 5127b26ee58076e9369e7c126c196793c2b12e73 diff --git a/vendor/nim-serde b/vendor/nim-serde index b1e5e5d3..83e4a2cc 160000 --- a/vendor/nim-serde +++ b/vendor/nim-serde @@ -1 +1 @@ -Subproject commit b1e5e5d39a99ea56b750f6d9272dd319f4ad4291 +Subproject commit 83e4a2ccf621d3040c6e7e0267393ca2d205988e diff --git a/vendor/nim-serialization b/vendor/nim-serialization index 384eb256..f709bd9e 160000 --- a/vendor/nim-serialization +++ b/vendor/nim-serialization @@ -1 +1 @@ -Subproject commit 384eb2561ee755446cff512a8e057325848b86a7 +Subproject commit f709bd9e16b1b6870fe3e4401196479e014a2ef6