feat: zkey-hash from chain

This commit is contained in:
Adam Uhlíř 2024-01-24 11:45:02 +01:00
parent 2fc7c75fd2
commit 83e0cae3fd
No known key found for this signature in database
GPG Key ID: 1D17A9E81F76155B
4 changed files with 12 additions and 2 deletions

View File

@ -17,13 +17,15 @@ type
period*: UInt256 # proofs requirements are calculated per period (in seconds)
timeout*: UInt256 # mark proofs as missing before the timeout (in seconds)
downtime*: uint8 # ignore this much recent blocks for proof requirements
zkeyHash*: string # hash of the zkey file which is linked to the verifier
func fromTuple(_: type ProofConfig, tupl: tuple): ProofConfig =
ProofConfig(
period: tupl[0],
timeout: tupl[1],
downtime: tupl[2]
downtime: tupl[2],
zkeyHash: tupl[3]
)
func fromTuple(_: type CollateralConfig, tupl: tuple): CollateralConfig =

View File

@ -38,6 +38,11 @@ proc approveFunds(market: OnChainMarket, amount: UInt256) {.async.} =
discard await token.increaseAllowance(market.contract.address(), amount).confirm(1)
method getZkeyHash*(market: Market): Future[?string] {.async.} =
let config = await market.contract.config()
let period = config.proofs.period
return
method getSigner*(market: OnChainMarket): Future[Address] {.async.} =
return await market.signer.getAddress()

View File

@ -30,6 +30,9 @@ type
expiry*: UInt256
ProofChallenge* = array[32, byte]
method getZkeyHash*(market: Market): Future[?string] {.base, async.} =
raiseAssert("not implemented")
method getSigner*(market: Market): Future[Address] {.base, async.} =
raiseAssert("not implemented")

@ -1 +1 @@
Subproject commit b5f33992b67df3733042a7d912c854700e8c863c
Subproject commit d40077118dd552b44d20830d0510934d36e5cd97