fix test_helper: able to parse overflow tx value

This commit is contained in:
jangko 2022-02-10 15:47:31 +07:00
parent b4283aeb1f
commit 231487197f
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
1 changed files with 4 additions and 1 deletions

View File

@ -219,7 +219,10 @@ proc getFixtureTransaction*(j: JsonNode, dataIndex, gasIndex, valueIndex: int):
if rawTo != "": if rawTo != "":
toAddr = some(rawTo.parseAddress) toAddr = some(rawTo.parseAddress)
let value = fromHex(UInt256, j["value"][valueIndex].getStr) let hexStr = j["value"][valueIndex].getStr
# stTransactionTest/ValueOverflow.json
# prevent parsing exception and subtitute it with max uint256
let value = if ':' in hexStr: high(UInt256) else: fromHex(UInt256, hexStr)
let payload = j["data"][dataIndex].getStr.safeHexToSeqByte let payload = j["data"][dataIndex].getStr.safeHexToSeqByte
var secretKey = j["secretKey"].getStr var secretKey = j["secretKey"].getStr