nim-codex/dagger/por/timing/proofs.nim
markspanbroek b88561e090
Subscribe to proof submissions (#83)
* Update dagger-contracts

* [proving] rename ProofTiming -> Proofs

* Update nim-ethers to 0.1.4

* [proving] Subscribe to proof submissions

* [proving] support proof submission through the Proving abstraction
2022-04-13 10:41:48 -06:00

52 lines
1.6 KiB
Nim

import pkg/chronos
import pkg/stint
import pkg/upraises
import ./periods
export chronos
export stint
export periods
type
Proofs* = ref object of RootObj
Subscription* = ref object of RootObj
OnProofSubmitted* = proc(id: ContractId, proof: seq[byte]) {.gcsafe, upraises:[].}
ContractId* = array[32, byte]
method periodicity*(proofs: Proofs):
Future[Periodicity] {.base, async.} =
raiseAssert("not implemented")
method getCurrentPeriod*(proofs: Proofs):
Future[Period] {.base, async.} =
raiseAssert("not implemented")
method waitUntilPeriod*(proofs: Proofs,
period: Period) {.base, async.} =
raiseAssert("not implemented")
method isProofRequired*(proofs: Proofs,
id: ContractId): Future[bool] {.base, async.} =
raiseAssert("not implemented")
method willProofBeRequired*(proofs: Proofs,
id: ContractId): Future[bool] {.base, async.} =
raiseAssert("not implemented")
method getProofEnd*(proofs: Proofs,
id: ContractId): Future[UInt256] {.base, async.} =
raiseAssert("not implemented")
method submitProof*(proofs: Proofs,
id: ContractId,
proof: seq[byte]) {.base, async.} =
raiseAssert("not implemented")
method subscribeProofSubmission*(proofs: Proofs,
callback: OnProofSubmitted):
Future[Subscription] {.base, async.} =
raiseAssert("not implemented")
method unsubscribe*(subscription: Subscription) {.base, async, upraises:[].} =
raiseAssert("not implemented")