adding verification

This commit is contained in:
Jaremy Creechley 2024-05-28 23:35:56 +01:00
parent ace23791a8
commit cee3340bd5
No known key found for this signature in database
GPG Key ID: 4E66FB67B21D3300
1 changed files with 9 additions and 1 deletions

View File

@ -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)