can successfully fetch zkeyhash from chain

This commit is contained in:
thatben 2025-03-18 14:31:10 +01:00
parent ed100ef27e
commit b3e147ace1
No known key found for this signature in database
GPG Key ID: 62C543548433D43E
2 changed files with 29 additions and 3 deletions

View File

@ -18,7 +18,7 @@ import ./components/todolist
proc createComponents*(state: State): Future[?!seq[Component]] {.async.} =
var components: seq[Component] = newSeq[Component]()
aaa()
await aaa(state.config)
let clock = createClock()

View File

@ -1,4 +1,30 @@
import ./marketplace/market
import pkg/ethers
import pkg/questionable
proc aaa*() =
import ./marketplace/market
import ./marketplace/marketplace
import ../config
proc aaa*(config: Config) {.async.} =
echo "aaa"
let provider = JsonRpcProvider.new(config.ethProvider)
without marketplaceAddress =? Address.init(config.marketplaceAddress):
raiseAssert("A!")
let marketplace = Marketplace.new(marketplaceAddress, provider)
let market = OnChainMarket.new(marketplace)
echo "bbb"
echo "running with marketplace address: " & $marketplaceAddress
try:
without zkeyhash =? await market.getZkeyHash():
echo "couldn't get zkeyhash"
return
echo "zkeyhash=" & $zkeyhash
except CatchableError as err:
echo "catchable error! " & err.msg
echo "ccc"