Fix fromJson checks for uint256

This commit is contained in:
kdeme 2019-06-19 21:10:01 +02:00 committed by zah
parent 529fda3e3e
commit e94c2f7c15
1 changed files with 1 additions and 1 deletions

View File

@ -264,7 +264,7 @@ proc fromJson*(n: JsonNode, argName: string, result: var Identifier) =
proc fromJson*(n: JsonNode, argName: string, result: var UInt256) =
n.kind.expect(JString, argName)
let hexStr = n.getStr()
if hexStr.len <= 66 and hexStr.isValidHexData:
if not (hexStr.len <= 66 and hexStr.isValidHexQuantity):
raise newException(ValueError, invalidMsg(argName) & " as a UInt256 \"" & hexStr & "\"")
result = readUintBE[256](hexToPaddedByteArray[32](hexStr))