From cee3340bd5248d9fa55a1bef099fe9a030896128 Mon Sep 17 00:00:00 2001 From: Jaremy Creechley Date: Tue, 28 May 2024 23:35:56 +0100 Subject: [PATCH] adding verification --- benchmarks/circomcompat_cli.nim | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/benchmarks/circomcompat_cli.nim b/benchmarks/circomcompat_cli.nim index 94f7f318..12093db7 100644 --- a/benchmarks/circomcompat_cli.nim +++ b/benchmarks/circomcompat_cli.nim @@ -70,8 +70,16 @@ proc parseJsons( if ctx.pushInputU64(key.cstring, num) != ERR_OK: raise newException(ValueError, "Failed to push JInt") elif value.kind == JArray: + var inputs = newSeq[UInt256]() for item in value: - ctx.parseJsons(key, item) + if item.kind == JString: + inputs.add item.parseBigInt() + elif item.kind == JArray: + for subitem in item: + doAssert subitem.kind == JString + inputs.add subitem.parseBigInt() + if ctx.pushInputU256Array(key.cstring, inputs[0].addr, inputs.len.uint) != ERR_OK: + raise newException(ValueError, "Failed to push BigInt from dec string") else: echo "unhandled val: " & $value raise newException(ValueError, "Failed to push Json of " & $value.kind)