mirror of
https://github.com/status-im/nim-dagger.git
synced 2025-02-27 13:50:47 +00:00
adding verification
This commit is contained in:
parent
ace23791a8
commit
cee3340bd5
@ -70,8 +70,16 @@ proc parseJsons(
|
|||||||
if ctx.pushInputU64(key.cstring, num) != ERR_OK:
|
if ctx.pushInputU64(key.cstring, num) != ERR_OK:
|
||||||
raise newException(ValueError, "Failed to push JInt")
|
raise newException(ValueError, "Failed to push JInt")
|
||||||
elif value.kind == JArray:
|
elif value.kind == JArray:
|
||||||
|
var inputs = newSeq[UInt256]()
|
||||||
for item in value:
|
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:
|
else:
|
||||||
echo "unhandled val: " & $value
|
echo "unhandled val: " & $value
|
||||||
raise newException(ValueError, "Failed to push Json of " & $value.kind)
|
raise newException(ValueError, "Failed to push Json of " & $value.kind)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user